func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mod = 1e9 + 7;   const int maxm = 1e5 + 80;   const int maxn = 5e3 + 80;   const int up = 20;   template <class T>   void read(T &x) {     x = 0;     char c = getchar();     int f = 1;     for (; c <  0  || c >  9 ; c = getchar())       if (c ==  - ) f = -1;     for (;  0  <= c && c <=  9 ; c = getchar()) x = x * 10 + (c ^ 48);     x *= f;   }   unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();   mt19937 rand_num(seed);   uniform_int_distribution<int> dist(0, 10000000);   mt19937 rnd(time(NULL));   int e[maxm][2], cnt[maxm];   int f[maxm], flag, nxt;   int get_rand(int from, int to) {     int x = dist(rand_num) % (to - from + 1);     return x + from;   }   bool solve(int n, int m) {     shuffle(f + 1, f + 1 + n, rnd);     for (int i = 2; i <= m; i++) {       int u = f[i - 1], v = f[i], ti = 0;       bool wa = (e[u][0] == v | e[u][1] == v);       if (wa && i == n) return false;       while (wa && ti < up) {         int t = get_rand(i + 1, n);         ti++;         swap(f[i], f[t]);         v = f[i];         wa = (e[u][0] == v | e[u][1] == v);       }       if (ti == up) return false;     }     nxt = 0;     if (m == 2 || m == 1) nxt = 1;     if (e[f[m]][0] == f[1] || e[f[m]][1] == f[1]) nxt = 1;     if (nxt == 1 && n == m) return false;     if (nxt == 1) {       int u = f[m], v = f[m + 1], ti = 0;       bool wa = (e[u][0] == v | e[u][1] == v);       while (wa && ti < up) {         int t = get_rand(m + 1, n);         ti++;         swap(f[m + 1], f[t]);         v = f[m + 1];         wa = (e[u][0] == v | e[u][1] == v);       }       if (ti == up) return false;     }     flag = 1;     return true;   }   void MC() {     int n, m;     read(n);     read(m);     for (int i = 1; i <= m; i++) {       int u, v;       read(u);       read(v);       e[u][cnt[u]++] = v;       e[v][cnt[v]++] = u;     }     if (n == 2 && m == 2 || m > n) {       printf( -1 n );       return;     }     flag = 0;     for (int i = 1; i <= n; i++) f[i] = i;     for (int i = 1; i <= up + up; i++)       if (solve(n, m)) break;     if (!flag) {       printf( -1 n );       return;     }     for (int i = 2; i <= m; i++) printf( %d %d n , f[i - 1], f[i]);     if (!nxt)       printf( %d %d n , f[m], f[1]);     else       printf( %d %d n , f[m], f[m + 1]);   }   int main() {     MC();     return 0;   }   