#include <bits/stdc++.h>
using namespace std;
set<int> s[(int)1e5 + 2][102];
int p[(int)1e5 + 2];
int main() {
  clock_t st = clock();
  int n, m, u, v, i;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    s[u][v / 1000].insert(v);
    s[v][u / 1000].insert(u);
  }
  srand(27422716);
  while ((clock() - st) / CLOCKS_PER_SEC < 1.0) {
    for (i = 0; i < n; p[i] = i) i++;
    random_shuffle(p + 1, p + n + 1);
    p[n + 1] = p[1];
    for (i = 1; i <= m; i++)
      if (s[p[i]][p[i + 1] / 1000].count(p[i + 1])) break;
    if (i == m + 1) {
      for (i = 1; i <= m; i++) printf("%d %d\n", p[i], p[i + 1]);
      return 0;
    }
  }
  return printf("-1\n"), 0;
}
