#include <bits/stdc++.h>
const int maxn = 1e5 + 1000;
using namespace std;
int n, m, fa[maxn], in[maxn];
vector<int> side[maxn];
struct gg {
  int u, v;
} edge[maxn * 2];
int get(int x) {
  if (fa[x] == x) return x;
  fa[x] = get(fa[x]);
  return fa[x];
}
void uni(int x, int y) { fa[get(x)] = get(y); }
void dfs(int now, int fa) {
  for (int i = 0; i < side[now].size(); i++) {
    int v = side[now][i];
    if (v == fa) continue;
    dfs(v, now);
    if (in[v] & 1) {
      printf("%d %d\n", now, v);
    } else {
      in[now]++;
      printf("%d %d\n", v, now);
    }
  }
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  if (m & 1) {
    printf("-1");
    return 0;
  }
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    if (get(u) != get(v)) {
      side[u].push_back(v);
      side[v].push_back(u);
      uni(u, v);
    } else {
      in[u]++;
      printf("%d %d\n", v, u);
    }
  }
  dfs(1, 0);
  return 0;
}
