#include<bits/stdc++.h>
using namespace std;
#define int long long
int deg[100005];
vector<int> p[100005];
signed main() {
int n, m;
cin >> n >> m;
int x, y;
for (int i = 1; i <= m; ++i) {
cin >> x >> y;
p[y].push_back(x);
}
vector<int> a;
for(int i = 1; i <= n; ++i){
a.push_back(i);
}
int attempts = 10000;
while (attempts--) {
random_shuffle(a.begin(), a.end());
vector<pair<int, int>> res;
bool check = true;
for (int i = 1; i < n; ++i) {
int u = a[i - 1];
int v = a[i];
for(int x : p[u]){
if(x == v){
check = false;
break;
}
}
for(int x : p[v]){
if(x == u){
check = false;
break;
}
}
res.push_back({u,v});
}
if (check) {
if(res.size() > m){
int s = m;
for (auto e : res) {
if(m > 0){
cout << e.first << " " << e.second << endl;
++deg[e.first];
++deg[e.second];
--m;
}
}
}else{
for (auto e : res) {
cout << e.first << " " << e.second << endl;
++deg[e.first];
++deg[e.second];
}
if (res.size() < m) {
int ans = m - res.size();
for (int i = 0; i < n && ans > 0; ++i) {
for (int j = i + 2; j < n && ans > 0; ++j) {
int u = a[i];
int v = a[j];
if (deg[u] < 2 && deg[v] < 2) {
cout << u << " " << v << endl;
deg[u]++;
deg[v]++;
ans--;
}
}
}
}
}
return 0;
}
}
cout << "-1" << endl;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBpbnQgbG9uZyBsb25nCmludCBkZWdbMTAwMDA1XTsgCnZlY3RvcjxpbnQ+IHBbMTAwMDA1XTsKCnNpZ25lZCBtYWluKCkgewogICAgaW50IG4sIG07CiAgICBjaW4gPj4gbiA+PiBtOwogICAgaW50IHgsIHk7CiAgICBmb3IgKGludCBpID0gMTsgaSA8PSBtOyArK2kpIHsKICAgICAgICBjaW4gPj4geCA+PiB5OwogICAgICAgIHBbeV0ucHVzaF9iYWNrKHgpOwogICAgfQoKICAgIHZlY3RvcjxpbnQ+IGE7CiAgICBmb3IoaW50IGkgPSAxOyBpIDw9IG47ICsraSl7CiAgICAJYS5wdXNoX2JhY2soaSk7Cgl9CgogICAgaW50IGF0dGVtcHRzID0gMTAwMDA7CiAgICB3aGlsZSAoYXR0ZW1wdHMtLSkgewogICAgICAgIHJhbmRvbV9zaHVmZmxlKGEuYmVnaW4oKSwgYS5lbmQoKSk7CgogICAgICAgIHZlY3RvcjxwYWlyPGludCwgaW50Pj4gcmVzOwogICAgICAgIGJvb2wgY2hlY2sgPSB0cnVlOwogICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgbjsgKytpKSB7CiAgICAgICAgICAgIGludCB1ID0gYVtpIC0gMV07CiAgICAgICAgICAgIGludCB2ID0gYVtpXTsKICAgICAgICAgICAgZm9yKGludCB4IDogcFt1XSl7CiAgICAgICAgICAgIAlpZih4ID09IHYpewogICAgICAgICAgICAJCWNoZWNrID0gZmFsc2U7CiAgICAgICAgICAgIAkJYnJlYWs7CgkJCQl9CgkJCX0KCQkJZm9yKGludCB4IDogcFt2XSl7CgkJCQlpZih4ID09IHUpewoJCQkJCWNoZWNrID0gZmFsc2U7CgkJCQkJYnJlYWs7CgkJCQl9CgkJCX0KCQkJcmVzLnB1c2hfYmFjayh7dSx2fSk7CiAgICAgICAgfQogICAgICAgIGlmIChjaGVjaykgewogICAgICAgIAlpZihyZXMuc2l6ZSgpID4gbSl7CiAgICAgICAgCQlpbnQgcyA9IG07CiAgICAgICAgCQlmb3IgKGF1dG8gZSA6IHJlcykgewogICAgICAgIAkJaWYobSA+IDApewogICAgICAgICAgICAgICAgY291dCA8PCBlLmZpcnN0IDw8ICIgIiA8PCBlLnNlY29uZCA8PCBlbmRsOwogICAgICAgICAgICAgICAgKytkZWdbZS5maXJzdF07CgkJCQkrK2RlZ1tlLnNlY29uZF07CgkJCQktLW07IAoJCQl9CiAgICAgICAgICAgIH0KCQkJfWVsc2V7CiAgICAgICAgICAgIGZvciAoYXV0byBlIDogcmVzKSB7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGUuZmlyc3QgPDwgIiAiIDw8IGUuc2Vjb25kIDw8IGVuZGw7CiAgICAgICAgICAgICAgICArK2RlZ1tlLmZpcnN0XTsKCQkJCSsrZGVnW2Uuc2Vjb25kXTsgIAogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmIChyZXMuc2l6ZSgpIDwgbSkgewogICAgICAgICAgICAgICAgaW50IGFucyA9IG0gLSByZXMuc2l6ZSgpOwogICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuICYmIGFucyA+IDA7ICsraSkgewogICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGogPSBpICsgMjsgaiA8IG4gJiYgYW5zID4gMDsgKytqKSB7CiAgICAgICAgICAgICAgICAgICAgICAgIGludCB1ID0gYVtpXTsKICAgICAgICAgICAgICAgICAgICAgICAgaW50IHYgPSBhW2pdOwogICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVnW3VdIDwgMiAmJiBkZWdbdl0gPCAyKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IHUgPDwgIiAiIDw8IHYgPDwgZW5kbDsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZ1t1XSsrOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVnW3ZdKys7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbnMtLTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgfQogICAgfQogICAgY291dCA8PCAiLTEiIDw8IGVuZGw7Cn0K