#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int evs[MAXN];
vector<pair<int, int> > edges;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    edges.push_back({u, v});
  }
  if (m % 2) {
    cout << "-1\n";
    return 0;
  }
  random_shuffle(edges.begin(), edges.end());
  for (int i = 0; i < m; i++) evs[edges[i].first]++;
  for (int k = 0; k < 1000; k++) {
    for (int i = 0; i < m; i++) {
      int u = edges[i].first, v = edges[i].second;
      if (evs[u] % 2 == 0) continue;
      evs[u]--;
      evs[v]++;
      edges[i] = {v, u};
    }
  }
  for (int i = 0; i < m; i++)
    cout << edges[i].first << " " << edges[i].second << '\n';
}
