#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M;
  cin >> N >> M;
  long long count[N + 1];
  long long pair[N + 1];
  long long edge[M][2];
  for (long long i = 0; i < N + 1; i++) {
    pair[i] = 0;
    count[i] = 0;
  }
  for (long long i = 0; i < M; i++) {
    edge[i][0] = 0;
    edge[i][1] = 0;
  }
  long long edge_count = 0;
  for (long long i = 0; i < M; i++) {
    long long A, B;
    cin >> A >> B;
    count[A]++;
    count[B]++;
    if (count[A] == 2) {
      edge[edge_count][0] = A;
      edge[edge_count][1] = B;
      edge[edge_count + 1][0] = A;
      edge[edge_count + 1][1] = pair[A];
      edge_count += 2;
      count[A] -= 2;
      count[B] -= 1;
      count[pair[A]] -= 1;
      pair[A] = 0;
      pair[pair[A]] = 0;
    } else if (count[B] == 2) {
      edge[edge_count][0] = B;
      edge[edge_count][1] = A;
      edge[edge_count + 1][0] = B;
      edge[edge_count + 1][1] = pair[B];
      edge_count += 2;
      count[B] -= 2;
      count[A] -= 1;
      count[pair[B]] -= 1;
      pair[B] = 0;
      pair[pair[B]] = 0;
    } else {
      pair[A] = B;
      pair[B] = A;
    }
  }
  bool judge = true;
  for (long long i = 1; i < N + 1; i++) {
    if (count[i] != 0) {
      judge = false;
      break;
    }
  }
  if (judge) {
    for (long long i = 0; i < edge_count; i++) {
      cout << edge[i][0] << " " << edge[i][1] << endl;
    }
  } else {
    cout << -1 << endl;
  }
}
