#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int depth[maxn];
int out_put[maxn];
struct Node {
  int x, y;
};
vector<int> s[maxn];
void dfs(int now, int pre) {
  for (int i = 0; i < s[now].size(); i++) {
    int x = s[now][i];
    if (x == pre) continue;
    if (depth[x] == -1) {
      depth[x] = depth[now] + 1;
      dfs(x, now);
    } else {
      if (depth[x] > depth[now]) {
        printf("%d %d\n", now, x);
        out_put[now]++;
      }
    }
  }
  if (pre == -1) return;
  if (out_put[now] % 2) {
    printf("%d %d\n", now, pre);
    out_put[now]++;
  } else {
    printf("%d %d\n", pre, now);
    out_put[pre]++;
  }
}
int main() {
  int m, n;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    s[x].push_back(y);
    s[y].push_back(x);
  }
  if (m % 2) {
    puts("-1");
    return 0;
  }
  fill(depth, depth + n + 1, -1);
  dfs(1, -1);
  return 0;
}
