#include <bits/stdc++.h>
using namespace std;
int calc(int now, int prev, vector<unordered_map<int, bool> > &src,
         vector<unordered_map<int, bool> > &ans, vector<bool> &arrived) {
  if (arrived[now]) {
    return (src[now][prev]) ? 1 : 0;
  }
  arrived[now] = true;
  int pre = -1;
  for (pair<int, bool> p : src[now]) {
    int next = p.first;
    bool liv = p.second;
    if (next == prev) continue;
    if (!liv) continue;
    int res = calc(next, now, src, ans, arrived);
    if (res == 1) {
      if (pre == -1) {
        pre = next;
      } else {
        ans[now][pre] = true;
        ans[now][next] = true;
        src[pre][now] = false;
        src[next][now] = false;
        src[now][pre] = false;
        src[now][next] = false;
        pre = -1;
      }
    }
  }
  if (pre == -1)
    return 1;
  else {
    if (prev == -1)
      return 0;
    else {
      ans[now][pre] = true;
      ans[now][prev] = true;
      src[pre][now] = false;
      src[prev][now] = false;
      src[now][pre] = false;
      src[now][prev] = false;
      return 0;
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m % 2 == 1) {
    cout << -1 << endl;
    return 0;
  }
  vector<unordered_map<int, bool> > src(n);
  vector<unordered_map<int, bool> > ans(n);
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    src[a - 1][b - 1] = true;
    src[b - 1][a - 1] = true;
  }
  vector<bool> arrived(n);
  calc(0, -1, src, ans, arrived);
  for (int i = 0; i < n; i++) {
    for (pair<int, bool> p : ans[i]) {
      cout << (i + 1) << " " << (p.first + 1) << endl;
    }
  }
  return 0;
}
