#include <bits/stdc++.h>
using namespace std;
#define N 200005
#define M N

int n, m;
int tot = 0, fir[N], nxt[N << 1], to[N << 1];
int x[N << 1], y[N << 1], z[N << 1];

inline void addEdge(int u, int v) {
    nxt[++tot] = fir[u], fir[u] = tot, to[tot] = v;
}

int vis[N], d[N];

void dfs(int u) {
    vis[u] = 1;
    for (int i = fir[u], v; i; i = nxt[i]) {
        v = to[i]; if (vis[v]) continue;
        dfs(v);
        if (d[v]) z[(i + 1) / 2] ^= 1, d[v] = 0, d[u] ^= 1;
    }
}

int main() {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i)
        scanf("%d%d", x + i, y + i),
        addEdge(x[i], y[i]), addEdge(y[i], x[i]), d[x[i]] ^= 1, z[i] = 1;
    dfs(1);
    if (d[1]) {
        puts("-1");
        return 0;
    }
    for (int i = 1; i <= m; ++i)
        if (z[i]) printf("%d %d\n", x[i], y[i]);
        else printf("%d %d\n", y[i], x[i]);
    return 0;
}