#include <bits/stdc++.h>
using namespace std;

typedef long long               ll;
typedef unsigned long long      ull;

const int N = 100 * 1000 + 20;

vector <ll> adj[N];
bool vis[N];
ll d[N], outD[N];

void dfs(ll v) {
    vis[v] = true;
    for (auto u: adj[v]) {
        if (!vis[u]) {
            d[u] = d[v] + 1;
            dfs(u);
        }
        if (d[u] > d[v]) {
            if (!(outD[u] & 1)) {
                outD[v]++;
                cout << v << " " << u << endl;
            }
            else {
                outD[u]++;
                cout << u << ' '  << v << endl;
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
    ll n, m;
    cin >> n >> m;
    if (m & 1)
        return cout << -1 << endl, 0;
    for (int i = 0, u, v; i < m; i++) {
        cin >> v >> u;
        adj[v].push_back(u);
        adj[u].push_back(v);
    }
    dfs(1);
    return 0;
}
