#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<pair<int, int>> edges;
  vector<vector<int>> g(n);
  vector<int> deg(n);
  for (int i = 0; i < m; ++i) {
    int u, v;
    cin >> u >> v;
    --u, --v;
    edges.emplace_back(u, v);
    ++deg[u];
    g[u].push_back(i);
    g[v].push_back(i);
  }
  if (m % 2 == 1) {
    cout << "-1\n";
    return 0;
  }
  vector<int> par(n), par_id(n), used(n), tin(n), tout(n);
  vector<pair<int, int>> who;
  int timer = 0;
  function<int(int, int, int)> dfs = [&](int u, int p, int p_id) {
    used[u] = 1;
    par[u] = p;
    par_id[u] = p_id;
    tin[u] = timer++;
    vector<int> have;
    for (auto id : g[u]) {
      int v = edges[id].first ^ edges[id].second ^ u;
      if (!used[v]) {
        int ret = dfs(v, u, id);
        if (ret != -1) {
          have.push_back(ret);
        }
      }
    }
    if (deg[u] % 2 == 1) {
      have.push_back(u);
    }
    for (int i = 1; i < (int)have.size(); i += 2) {
      who.emplace_back(have[i - 1], have[i]);
    }
    tout[u] = timer++;
    if ((int)have.size() % 2 == 1)
      return have.back();
    else
      return -1;
  };
  dfs(0, -1, -1);
  auto anc = [&](int a, int b) {
    return tin[a] <= tin[b] && tout[b] <= tout[a];
  };
  for (auto p : who) {
    int a = p.first, b = p.second;
    int c = a;
    while (!anc(c, b)) {
      int i = par_id[c];
      swap(edges[i].first, edges[i].second);
      c = par[c];
    }
    c = b;
    while (!anc(c, a)) {
      int i = par_id[c];
      swap(edges[i].first, edges[i].second);
      c = par[c];
    }
  }
  for (auto p : edges) {
    cout << p.first + 1 << ' ' << p.second + 1 << '\n';
  }
}
