#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 5;
int n, m, out[M], vis[M];
vector<int> adj[M], g[M];
string s;
set<pair<int, int> > st, used, there;
void DFStree(int u) {
  vis[u] = 1;
  for (int v : adj[u]) {
    if (vis[v]) continue;
    used.insert({u, v});
    DFStree(v);
  }
}
bool dfs(int u, int p) {
  bool id = s[u] == '1' ? 1 : 0;
  for (int v : g[u]) {
    if (v == p) continue;
    bool k = dfs(v, u);
    if (k == 0) continue;
    used.erase({u, v});
    used.insert({v, u});
    if (id)
      id = 0;
    else
      id = k;
  }
  return id;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    there.insert({u, v});
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  DFStree(0);
  for (auto i : used) {
    g[i.first].push_back(i.second);
  }
  for (auto i : there) {
    if (used.find({i.second, i.first}) != used.end())
      out[i.second]++;
    else
      out[i.first]++;
  }
  for (int i = 0; i < n; i++) {
    s += (out[i] % 2) ? '1' : '0';
  }
  if (m % 2 || dfs(0, -1) != 0) {
    puts("-1");
    return 0;
  }
  for (auto i : there) {
    if (used.find({i.first, i.second}) != used.end() ||
        used.find({i.second, i.first}) != used.end())
      continue;
    used.insert({i.first, i.second});
  }
  for (auto i : used) cout << i.first + 1 << ' ' << 1 + i.second << endl;
}
