#include <iostream>
#include <vector>
#include <set>
#include <fstream>
const int maxn = 100 * 1000 + 5;
using namespace std;
int n, m;
vector<int> G[maxn];
set<int> a;
bool has = false;
int sr[maxn];
void back(int poz, int node) {
sr[poz] = node;
auto it = a.find(node);
if(it != a.end())
a.erase(it);
if(poz == m) {
has = true;
return;
}
if(has) return;
if(poz == m - 1) {
bool ok = true;
//cerr << "coa";
for(auto e : G[node])
if(e == 6)
ok = false;
if(ok)
back(poz + 1, 6);
}
for(auto v : a) {
bool ok = true;
for(auto e : G[node])
if(e == v)
ok = false;
if(!ok) continue;
back(poz + 1, v);
if(has) return;
}
a.insert(node);
}
bool mat[50][50];
int grad[500], l[500], r[500];
int main() {
//ifstream cin("C.in");
cin >> n >> m;
for(int i = 1; i <= m; ++i) {
int a, b; cin >> a >> b;
G[a].push_back(b);
G[b].push_back(a);
if(n <= 10) {
mat[a][b] = true, mat[b][a] = true;
}
}
for(int i = 1; i <= n; ++i)
a.insert(i);
if(n > 7) {
back(0, 6);
for(int i = 0; i < m; ++i) {
if(sr[i + 1] == n + 1)
sr[i + 1] = 1;
cout << sr[i] << " " << sr[i + 1] << "\n";
}
return 0;
} else {
int cnt = 0;
for(int i = 1; i <= n; ++i)
for(int j = i + 1; j <= n; ++j)
if(mat[i][j] == false) {
l[++cnt] = i;
r[cnt] = j;
}
for(int i = 0; i < (1 << cnt); ++i) {
int edges = 0;
for(int j = 0; j < n; ++j)
grad[j + 1] = 0;
for(int j = 0; j < cnt; ++j)
if(i & (1 << j)) {
grad[l[j + 1]]++;
grad[r[j + 1]]++;
edges++;
}
bool ok = true;
for(int j = 0; j < n; ++j)
if(grad[j + 1] > 2)
ok = false;
//cerr << edges << " " << ok << "\n";
if(ok && edges == m) {
//cerr << "hai\n";
for(int j = 0; j < cnt; ++j)
if(i & (1 << j))
cout << l[j + 1]<< " " << r[j + 1] << "\n";
return 0;
}
}
}
cout << "-1\n";
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8ZnN0cmVhbT4KY29uc3QgaW50IG1heG4gPSAxMDAgKiAxMDAwICsgNTsKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBtOwp2ZWN0b3I8aW50PiBHW21heG5dOwpzZXQ8aW50PiBhOwpib29sIGhhcyA9IGZhbHNlOwppbnQgc3JbbWF4bl07Cgp2b2lkIGJhY2soaW50IHBveiwgaW50IG5vZGUpIHsKICAgIAogICAgc3JbcG96XSA9IG5vZGU7CiAgICBhdXRvIGl0ID0gYS5maW5kKG5vZGUpOwogICAgaWYoaXQgIT0gYS5lbmQoKSkKICAgICAgICBhLmVyYXNlKGl0KTsKCiAgICBpZihwb3ogPT0gbSkgewogICAgICAgIGhhcyA9IHRydWU7CiAgICAgICAgcmV0dXJuOwogICAgfQoKICAgIGlmKGhhcykgcmV0dXJuOwogICAgCiAgICBpZihwb3ogPT0gbSAtIDEpIHsKICAgICAgICBib29sIG9rID0gdHJ1ZTsKICAgICAgICAvL2NlcnIgPDwgImNvYSI7CiAgICAgICAgZm9yKGF1dG8gZSA6IEdbbm9kZV0pCiAgICAgICAgICAgIGlmKGUgPT0gNikKICAgICAgICAgICAgICAgIG9rID0gZmFsc2U7CgogICAgICAgIGlmKG9rKQogICAgICAgICAgICBiYWNrKHBveiArIDEsIDYpOwogICAgfQogCiAgICBmb3IoYXV0byB2IDogYSkgewogICAgICAgIGJvb2wgb2sgPSB0cnVlOwoKICAgICAgICBmb3IoYXV0byBlIDogR1tub2RlXSkKICAgICAgICAgICAgaWYoZSA9PSB2KQogICAgICAgICAgICAgICAgb2sgPSBmYWxzZTsKCiAgICAgICAgaWYoIW9rKSBjb250aW51ZTsKICAgICAgICBiYWNrKHBveiArIDEsIHYpOwogICAgICAgIGlmKGhhcykgcmV0dXJuOwogICAgfQogICAgCiAgICBhLmluc2VydChub2RlKTsKfQpib29sIG1hdFs1MF1bNTBdOwppbnQgZ3JhZFs1MDBdLCBsWzUwMF0sIHJbNTAwXTsKCmludCBtYWluKCkgewogICAgCiAgICAvL2lmc3RyZWFtIGNpbigiQy5pbiIpOwoKICAgIGNpbiA+PiBuID4+IG07CgogICAgZm9yKGludCBpID0gMTsgaSA8PSBtOyArK2kpIHsKICAgICAgICBpbnQgYSwgYjsgY2luID4+IGEgPj4gYjsKICAgICAgICBHW2FdLnB1c2hfYmFjayhiKTsKICAgICAgICBHW2JdLnB1c2hfYmFjayhhKTsKICAgICAgICBpZihuIDw9IDEwKSB7CiAgICAgICAgICAgIG1hdFthXVtiXSA9IHRydWUsIG1hdFtiXVthXSA9IHRydWU7CiAgICAgICAgfQogICAgfQogICAgCiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47ICsraSkKICAgICAgICBhLmluc2VydChpKTsKICAgIAogICAgaWYobiA+IDcpIHsKICAgICAgICBiYWNrKDAsIDYpOwogICAgCiAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IG07ICsraSkgewogICAgICAgICAgICBpZihzcltpICsgMV0gPT0gbiArIDEpCiAgICAgICAgICAgICAgICBzcltpICsgMV0gPSAxOwogICAgICAgICAgICBjb3V0IDw8IHNyW2ldIDw8ICIgIiA8PCBzcltpICsgMV0gPDwgIlxuIjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9IGVsc2UgewogICAgICAgIGludCBjbnQgPSAwOwoKICAgICAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47ICsraSkKICAgICAgICAgICAgZm9yKGludCBqID0gaSArIDE7IGogPD0gbjsgKytqKQogICAgICAgICAgICAgICAgaWYobWF0W2ldW2pdID09IGZhbHNlKSB7CiAgICAgICAgICAgICAgICAgICAgbFsrK2NudF0gPSBpOwogICAgICAgICAgICAgICAgICAgIHJbY250XSA9IGo7CiAgICAgICAgICAgICAgICB9CiAgICAKICAgICAgICBmb3IoaW50IGkgPSAwOyBpIDwgKDEgPDwgY250KTsgKytpKSB7CiAgICAgICAgICAgIAogICAgICAgICAgICBpbnQgZWRnZXMgPSAwOwogICAgICAgICAgICBmb3IoaW50IGogPSAwOyBqIDwgbjsgKytqKQogICAgICAgICAgICAgICAgZ3JhZFtqICsgMV0gPSAwOwoKICAgICAgICAgICAgZm9yKGludCBqID0gMDsgaiA8IGNudDsgKytqKQogICAgICAgICAgICAgICAgaWYoaSAmICgxIDw8IGopKSB7CiAgICAgICAgICAgICAgICAgICAgZ3JhZFtsW2ogKyAxXV0rKzsKICAgICAgICAgICAgICAgICAgICBncmFkW3JbaiArIDFdXSsrOwogICAgICAgICAgICAgICAgICAgIGVkZ2VzKys7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICBib29sIG9rID0gdHJ1ZTsKICAgICAgICAgICAgZm9yKGludCBqID0gMDsgaiA8IG47ICsraikKICAgICAgICAgICAgICAgIGlmKGdyYWRbaiArIDFdID4gMikKICAgICAgICAgICAgICAgICAgICBvayA9IGZhbHNlOwogICAgICAgICAgICAvL2NlcnIgPDwgZWRnZXMgPDwgIiAiIDw8ICBvayA8PCAiXG4iOwoKICAgICAgICAgICAgaWYob2sgJiYgZWRnZXMgPT0gbSkgewogICAgICAgICAgICAgICAgLy9jZXJyIDw8ICJoYWlcbiI7CiAgICAgICAgICAgICAgICBmb3IoaW50IGogPSAwOyBqIDwgY250OyArK2opCiAgICAgICAgICAgICAgICAgICAgaWYoaSAmICgxIDw8IGopKQogICAgICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGxbaiArIDFdPDwgIiAiIDw8IHJbaiArIDFdIDw8ICJcbiI7CiAgICAgICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIAogICAgY291dCA8PCAiLTFcbiI7CiAgICByZXR1cm4gMDsKfQ==