#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, par[N], cnt[N], pos[N];
vector<int> vec[N];
vector<int> G[N];
vector<int> root;
bool visit[N];
map<pair<int, int>, bool> mp;
int find(int u) { return (u == par[u]) ? u : par[u] = find(par[u]); }
void join(int u, int v) {
  u = find(u), v = find(v);
  if (u == v) {
    cnt[u]++;
    return;
  }
  par[u] = v, cnt[v] += cnt[u] + 1, cnt[u] = 0;
}
bool cmp(int x, int y) { return vec[x].size() > vec[y].size(); }
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) par[i] = i;
  for (int i = 1; i <= m; ++i) {
    int u, v;
    cin >> u >> v;
    join(u, v), mp[pair<int, int>(u, v)] = mp[pair<int, int>(v, u)] = 1;
    G[u].push_back(v), G[v].push_back(u);
  }
  for (int i = 1; i <= n; ++i) {
    vec[find(i)].push_back(i);
  }
  for (int i = 1; i <= n; ++i) {
    if (find(i) != i) continue;
    root.push_back(i);
    int st = 0;
    for (auto j : vec[i]) {
      if (G[j].size() == 1) st = j;
    }
    if (!st) st = vec[i][0];
    vec[i].clear();
    vector<int> tmp;
    while (!visit[st]) {
      visit[st] = 1;
      tmp.push_back(st);
      for (auto j : G[st]) {
        if (visit[j]) continue;
        st = j;
        break;
      }
    }
    for (int j = 1; j < tmp.size(); j += 2) vec[i].push_back(tmp[j]);
    if (tmp.size() & 1)
      pos[i] = vec[i].size();
    else
      pos[i] = vec[i].size() - 1;
    if (tmp.size() > 5) swap(tmp[0], tmp[2]);
    for (int j = 0; j < tmp.size(); j += 2) vec[i].push_back(tmp[j]);
  }
  sort(root.begin(), root.end(), cmp);
  int r0 = root[0];
  bool flag = 0;
  for (auto i : root) {
    if (i == r0) continue;
    swap(vec[r0][pos[r0]], vec[i][pos[i]]);
    if (vec[i].size() == 1) {
      if (vec[r0].size() == 3 && cnt[r0] == 3) {
        if (!flag)
          flag = 1;
        else {
          vec[r0].push_back(vec[i][0]);
          vec[i].clear();
        }
      }
      if (vec[r0].size() == 4 && cnt[r0] == 4) {
        reverse(vec[r0].begin(), vec[r0].end());
        vec[r0].push_back(vec[i][0]);
        vec[i].clear();
      }
    } else {
      if (vec[r0].size() == cnt[r0] || vec[i].size() == cnt[i]) {
        reverse(vec[i].begin(), vec[i].end());
        cnt[r0] += cnt[i], cnt[i] = 0;
        for (auto j : vec[i]) vec[r0].push_back(j);
        vec[i].clear();
      }
    }
  }
  for (auto i : root) {
    if (!vec[i].size()) continue;
    for (int j = 1; j < vec[i].size(); ++j) {
      if (mp[pair<int, int>(vec[i][j - 1], vec[i][j])]) {
        cout << -1;
        return 0;
      }
    }
    if (vec[i].size() == cnt[i]) {
      if (mp[pair<int, int>(vec[i][0], vec[i].back())]) {
        cout << -1;
        return 0;
      }
    }
  }
  for (auto i : root) {
    if (!vec[i].size()) continue;
    for (int j = 1; j < vec[i].size(); ++j) {
      cout << vec[i][j - 1] << ' ' << vec[i][j] << '\n';
    }
    if (vec[i].size() == cnt[i]) {
      cout << vec[i][0] << ' ' << vec[i].back() << '\n';
    }
  }
}
