#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<int> adj[N];
int n, m, l[N], r[N], deg[N], vis[N], tree[N], par[N], d[N];
void dfs(int u) {
  vis[u] = 1;
  for (int i : adj[u]) {
    int v = u ^ l[i] ^ r[i];
    if (!vis[v]) {
      par[v] = i;
      tree[i] = 1;
      d[v] = d[u] + 1;
      dfs(v);
    }
  }
}
int main() {
  scanf("%d %d", &n, &m);
  if (m & 1) {
    puts("-1");
    exit(0);
  }
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d", &l[i], &r[i]);
    adj[l[i]].push_back(i);
    adj[r[i]].push_back(i);
  }
  dfs(1);
  for (int i = 1; i <= m; ++i) {
    if (!tree[i]) deg[l[i]] ^= 1;
  }
  vector<int> id(n - 1);
  iota(id.begin(), id.end(), 2);
  sort(id.begin(), id.end(), [](int i, int j) { return d[i] > d[j]; });
  for (int u : id) {
    int e = par[u];
    if (deg[u] ^ (l[e] == u)) swap(l[e], r[e]);
    deg[l[e]] ^= 1;
  }
  for (int i = 1; i <= m; ++i) {
    printf("%d %d\n", l[i], r[i]);
  }
}
