#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#define ll long long
#define MAXN 10000007;
using namespace std;
map<int ,int>mp;
int a[50005];
int main()
{
std::ios::sync_with_stdio(0);
int n, k, i, j;
cin >> k >> n;
for(i = 0; i < n; i++)
{
cin >> a[i];
mp[a[i]] = 1;
}
sort(a, a + n);
int flag = 0;
for(i = 0; i < n; i++)
{
if(mp[k - a[i]] == 1 && a[i] < k - a[i])
{
cout << a[i] << " " << k - a[i] << endl;
flag = 1;
}
}
if(flag == 0)cout << "No Solution" << endl;
return 0;
}