#include <bits/stdc++.h>
using namespace std;
struct su {
  int to, next;
} b[200005];
int n, m, top, f, t, ans;
int tou[100005];
int chu[100005];
bool vis[100005];
bool hei[100005];
inline int qr() {
  char ch;
  while ((ch = getchar()) < '0' || ch > '9')
    ;
  int res = ch ^ 48;
  while ((ch = getchar()) >= '0' && ch <= '9') res = res * 10 + (ch ^ 48);
  return res;
}
inline void dfs(int i) {
  vis[i] = 1;
  cout << i << " " << hei[i] << endl;
  if (hei[i]) {
    for (register int j = tou[i]; j; j = b[j].next) {
      if (vis[b[j].to]) continue;
      int to = b[j].to;
      --chu[to];
      if (chu[to] == 0 && !hei[to]) puts("-1"), exit(0);
      if (chu[to] == 1) dfs(to);
    }
  } else {
    for (register int j = tou[i]; j; j = b[j].next) {
      if (vis[b[j].to]) continue;
      int to = b[j].to;
      hei[i] = !hei[i];
      hei[to] = !hei[to];
      ++ans;
      --chu[to];
      if (chu[to] == 0 && !hei[to]) puts("-1"), exit(0);
      if (chu[to] == 1) dfs(to);
    }
  }
}
inline void dfs2(int i) {
  vis[i] = 1;
  ++t;
  cout << i << endl;
  for (register int j = tou[i]; j; j = b[j].next) {
    if (hei[b[j].to] || vis[b[j].to]) continue;
    dfs2(b[j].to);
  }
}
int main() {
  puts("-1");
  return 0;
  n = qr(), m = qr();
  int x, y;
  for (register int i = 1; i <= m; ++i) {
    x = qr(), y = qr();
    b[++top] = su{y, tou[x]};
    tou[x] = top;
    ++chu[x];
    b[++top] = su{x, tou[y]};
    tou[y] = top;
    ++chu[y];
  }
  for (register int i = 1; i <= n; ++i)
    if (chu[i] <= 1) dfs(i);
  for (register int i = 1; i <= n; ++i)
    if (!vis[i]) f = 1;
  cout << "f=" << f << endl;
  if (f) {
    for (register int i = 1; i <= n; ++i)
      if (!hei[i] && !vis[i]) {
        t = 0;
        dfs2(i);
        cout << i << " " << t << endl;
        if (t & 1) puts("-1"), exit(0);
        ans += t / 2;
      }
    printf("%d\n", ans);
  } else {
    for (register int i = 1; i <= n; ++i)
      if (!hei[i]) puts("-1"), exit(0);
    printf("%d\n", ans);
  }
  return 0;
}
