#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
struct Edge {
  int from, to;
  int id;
  int reverse_id;
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<vector<Edge>> graph(n);
  vector<Edge> edges;
  vector<int> is_actives(2 * m);
  vector<int> out_degrees(n);
  for (int i = 0; i < m; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    v1--;
    v2--;
    Edge e1({v1, v2, 2 * i, 2 * i + 1});
    Edge e2({v2, v1, 2 * i + 1, 2 * i});
    graph[v1].push_back(e1);
    graph[v2].push_back(e2);
    edges.push_back(e1);
    edges.push_back(e2);
    is_actives[2 * i] = true;
    out_degrees[v1]++;
  }
  if (m % 2 == 1) {
    cout << -1 << endl;
    return 0;
  }
  vector<int> visited(n, 0);
  vector<int> used_edges(n, -1);
  function<void(int, int)> dfs =
      function<void(int, int)>([&](int v, int parent) {
        visited[v] = 1;
        for (const auto& edge : graph[v]) {
          if (edge.to == parent) continue;
          if (visited[edge.to]) continue;
          used_edges[edge.to] = edge.id;
          dfs(edge.to, v);
        }
        if (out_degrees[v] % 2 == 1) {
          int edge_id = used_edges[v];
          if (edge_id < 0) return;
          int reverse_edge_id = edges[edge_id].reverse_id;
          if (is_actives[edge_id]) {
            out_degrees[edges[edge_id].from]--;
            out_degrees[edges[edge_id].to]++;
            is_actives[edge_id] = false;
            is_actives[reverse_edge_id] = true;
          } else {
            out_degrees[edges[edge_id].to]++;
            out_degrees[edges[edge_id].from]--;
            is_actives[edge_id] = true;
            is_actives[reverse_edge_id] = false;
          }
        }
      });
  dfs(0, -1);
  for (int i = 0; i < 2 * m; i++) {
    if (is_actives[i]) {
      cout << edges[i].from + 1 << " " << edges[i].to + 1 << endl;
    }
  }
}
