#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int n, m;
int lvl[MAXN], p[MAXN], par[MAXN];
bool visited[MAXN];
vector<int> adj[MAXN];
vector<pair<int, int> > e;
int getParent(int x) { return (p[x] == x) ? x : getParent(p[x]); }
void conn(int a, int b) {
  int pa = getParent(a), pb = getParent(b);
  if (pa != pb) {
    if (lvl[pa] < lvl[pb])
      p[pa] = pb;
    else
      p[pb] = pa;
    if (lvl[pa] == lvl[pb]) lvl[pa]++;
  }
}
void dfs(int pos, int prev) {
  visited[pos] = true;
  for (int i : adj[pos]) {
    if (visited[i]) continue;
    dfs(i, pos);
  }
  if (par[pos] == 1) {
    e.push_back(pair<int, int>(pos, prev));
    par[pos] = 1 - par[pos];
  } else if (pos != 0) {
    e.push_back(pair<int, int>(prev, pos));
    par[prev] = 1 - par[prev];
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    p[i] = i;
    lvl[i] = 0;
    par[i] = 0;
  }
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    if (getParent(u) != getParent(v)) {
      conn(u, v);
      adj[u].push_back(v);
      adj[v].push_back(u);
    } else {
      e.push_back(pair<int, int>(u, v));
      par[u] = 1 - par[u];
    }
  }
  dfs(0, -1);
  if (m % 2 == 1) {
    printf("-1\n");
  } else {
    for (pair<int, int> i : e) {
      printf("%d %d\n", i.first + 1, i.second + 1);
    }
  }
}
