#include <bits/stdc++.h>
using namespace std;
const int maxm = 1e5 + 5;
struct edge {
  int nxt, to;
} e[maxm << 1];
vector<int> V[maxm];
int head[maxm], tot = 1, out[maxm], vis[maxm], in[maxm];
void add(int u, int v) {
  e[++tot] = (edge){head[u], v}, head[u] = tot;
  e[++tot] = (edge){head[v], u}, head[v] = tot;
}
void dfs(int u) {
  vis[u] = 1;
  for (int i = head[u]; i != 0; i = e[i].nxt) {
    int v = e[i].to;
    if (vis[v]) continue;
    if (out[u])
      out[u] ^= 1, in[i] = 1;
    else
      out[v] ^= 1, in[i ^ 1] = 1;
  }
  for (int i = head[u]; i != 0; i = e[i].nxt) {
    int v = e[i].to;
    if (vis[v]) continue;
    dfs(v);
  }
  if (out[u]) {
    puts("-1");
    exit(0);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    V[u].push_back(v);
  }
  for (int i = 1; i <= n; i++) random_shuffle(V[i].begin(), V[i].end());
  for (int u = 1; u <= n; u++)
    for (auto v : V[u]) add(u, v);
  dfs(1);
  for (int u = 1; u <= n; u++)
    for (int i = head[u]; i != 0; i = e[i].nxt)
      if (in[i]) printf("%d %d\n", u, e[i].to);
  return 0;
}
