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

const int maxn = 1e5 + 20;

bool visited[maxn];
int n, m, a, b, outDegree[maxn], dis[maxn];
vector<int> graph[maxn];

void dfs(int i) {
    visited[i] = 1;
    for (int x : graph[i]) {
        if (!visited[x]){
            dis[x] = dis[i] + 1; 
            dfs(x);
        }
        if (dis[x] > dis[i]) {
            if (outDegree[x] % 2 == 0){
                outDegree[i]++;
                cout << i << " " << x << endl;
            }
            else{
                outDegree[x] ++;
                cout << x << ' '  << i << endl;
            }
        }
    }
}
int main() {
    int n, m;
    cin >> n >> m;
    if (m % 2 == 1)
        return cout << -1 << endl, 0;
    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    dfs(1);    
}