#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
template <typename T>
int select(int p, const T &q) {
  int s0 = (p == 0 ? INF : (int)q[0].size());
  int s1 = (p == 1 ? INF : (int)q[1].size());
  int s2 = (p == 2 ? INF : (int)q[2].size());
  int msize = min(s0, min(s1, s2));
  if (msize == s0) {
    return 0;
  } else if (msize == s1) {
    return 1;
  } else {
    return 2;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  vector<vector<int> > conn(n);
  vector<int> degrees(n);
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    conn[a].push_back(b);
    conn[b].push_back(a);
    ++degrees[a];
    ++degrees[b];
  }
  if (n <= 9) {
    vector<vector<int> > mat(n, vector<int>(n));
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < conn[i].size(); ++j) {
        mat[i][conn[i][j]] = 1;
      }
    }
    vector<int> perm(n);
    for (int i = 0; i < n; ++i) {
      perm[i] = i;
    }
    bool accept = false;
    do {
      bool valid = true;
      for (int i = 0; i < m; ++i) {
        const int u = perm[i], v = perm[(i + 1) % n];
        if (mat[u][v]) {
          valid = false;
        }
      }
      if (valid) {
        accept = true;
        break;
      }
    } while (next_permutation(perm.begin(), perm.end()));
    if (!accept) {
      cout << -1 << endl;
    } else {
      for (int i = 0; i < m; ++i) {
        const int u = perm[i], v = perm[(i + 1) % n];
        cout << (u + 1) << " " << (v + 1) << endl;
      }
    }
    return 0;
  }
  vector<int> types(n, -1);
  vector<vector<int> > q(3);
  for (int i = 0; i < n; ++i) {
    if (types[i] < 0 && degrees[i] <= 1) {
      int p = -1, prev = -1, cur = i;
      while (true) {
        types[cur] = 0;
        int k = select(p, q);
        q[k].push_back(cur);
        p = k;
        if (conn[cur].size() >= 1 && conn[cur][0] != prev) {
          prev = cur;
          cur = conn[cur][0];
        } else if (conn[cur].size() >= 2) {
          prev = cur;
          cur = conn[cur][1];
        } else {
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    if (types[i] >= 0) {
      continue;
    }
    int pfirst = -1, p = -1, prev = -1, cur = i;
    do {
      const int v = conn[cur][conn[cur][0] == prev ? 1 : 0];
      types[cur] = 1;
      int k = select(p, q);
      if (p < 0) {
        pfirst = k;
      } else if (p >= 0 && v == i && pfirst != p) {
        k = 3 - pfirst - p;
      }
      q[k].push_back(v);
      p = k;
      prev = cur;
      cur = v;
    } while (cur != i);
  }
  vector<int> u, v;
  for (int i = 0; i < 3; ++i) {
    if (q[i].size() == 2) {
      u.push_back(q[i][0]);
      v.push_back(q[i][1]);
    } else if (q[i].size() >= 3) {
      for (int j = 0; j < q[i].size(); ++j) {
        u.push_back(q[i][j]);
        v.push_back(q[i][(j + 1) % q[i].size()]);
      }
    }
  }
  if (u.size() < m) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 0; i < m; ++i) {
    cout << (u[i] + 1) << " " << (v[i] + 1) << endl;
  }
  return 0;
}
