func_code_string: #include <bits/stdc++.h>   #pragma comment(linker,  /STACK:300000000 )   const long double eps = 1e-20;   const long double pi = acos(-1.0);   const long long inf = 1000 * 1000 * 1000 * 1000 * 1000 * 1000;   const long long base = 1000 * 1000 * 1000 + 7;   using namespace std;   int n, m, z, a[111111], x, y;   bool fl;   set<int> g[111111];   int main() {     ios_base ::sync_with_stdio(false);     cin >> n >> m;     for (int i = 0; i < (m); i++) {       cin >> x >> y;       x;       y;       g[x].insert(y);       g[y].insert(x);     }     for (int i = 0; i < (n); i++) a[i] = i + 1;     if (n < 9) {       do {         z = 0;         fl = true;         for (int i = 0; i < (n); i++) {           if (z == m) break;           if (g[a[i]].find(a[(i + 1) % n]) != g[a[i]].end()) {             fl = false;             break;           }           if (!fl) break;           z++;         }         if (fl && z == m) {           z = 0;           for (int i = 0; i < (n); i++) {             if (z == m) return 0;             cout << a[i] <<     << a[(i + 1) % n] << endl;             z++;           }           return 0;         }       } while (next_permutation(a, a + n));       cout <<  -1 ;       return 0;     }     for (int test = 0; test < (666); test++) {       random_shuffle(a, a + n);       z = 0;       fl = true;       for (int i = 0; i < (n); i++) {         if (z == m) break;         if (g[a[i]].find(a[(i + 1) % n]) != g[a[i]].end()) {           fl = false;           break;         }         if (!fl) break;         z++;       }       if (fl && z == m) {         z = 0;         for (int i = 0; i < (n); i++) {           if (z == m) return 0;           cout << a[i] <<     << a[(i + 1) % n] << endl;           z++;         }         return 0;       }     }     cout <<  -1 ;     return 0;   }   