#include <bits/stdc++.h>
using namespace std;
int cnt[1000007];
vector<int> adj[1000007];
bool visited[1000007];
vector<pair<int, int> > ans;
map<int, bool> check[1000007];
void DFS(int u) {
  visited[u] = 1;
  for (auto i = (0); i <= ((int)adj[u].size() - 1); ++i) {
    int v = adj[u][i];
    if (!visited[v]) DFS(v);
    if (check[u][v] || check[v][u]) continue;
    check[u][v] = check[v][u] = 1;
    if (cnt[v]) {
      ++cnt[v];
      ans.emplace_back(v, u);
    } else {
      ++cnt[u];
      ans.emplace_back(u, v);
    }
  }
  return;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (auto i = (1); i <= (m); ++i) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].emplace_back(v);
    adj[v].emplace_back(u);
  }
  DFS(1);
  for (auto i = (1); i <= (n); ++i)
    if (cnt[i] % 2) {
      puts("-1");
      return 0;
    }
  for (auto i = (0); i <= ((int)ans.size() - 1); ++i)
    printf("%d %d\n", ans[i].first, ans[i].second);
  return 0;
}
