#include <iostream>
#include <utility>
#include <vector>
#include <queue>
using namespace std;
typedef pair<int, int> P;

const int INF = 10000000;

int main()
{
    int n, m;
    cin >> n >> m;
    if(m % 2){
        cout << -1 << endl;
        return 0;
    }
    int a[100002], b[100002];
    vector<P> w[100002];
    for(int i = 0; i < m; i++){
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
        w[a[i]].push_back(P(b[i], i));
        w[b[i]].push_back(P(a[i], i));
    }
    int st[100002] {0};
    queue<int> que;
    int looked[100002] {0};
    looked[0] = 1;
    que.push(0);
    while(que.size()){
        int now = que.front();
        que.pop();
        int l = w[now].size();
        for(int i = 0; i < l; i++){
            int next = w[now][i].first;
            if(looked[next] == 0){
                looked[next] = 1;
                que.push(next);
                st[w[now][i].second] = 1;
            }
        }
    }
    vector<int> v[100002];
    int s[100002] {0};
    int e[100002] {0};
    for(int i = 0; i < m; i++){
        if(st[i]){
            v[a[i]].push_back(b[i]);
            v[b[i]].push_back(a[i]);
            s[a[i]]++;
            s[b[i]]++;
        }
        else{
            cout << a[i] + 1 << " " << b[i] + 1 << endl;
            e[a[i]] = 1 - e[a[i]];
        }
    }
    for(int i = 0; i < n; i++){
        if(s[i] == 1){
            int c = v[i][0];
            v[i][0] = INF;
            int l = v[c].size();
            for(int j = 0; j < l; j++){
                if(v[c][j] == i) v[c][j] = INF;
            }
            if(e[i]){
                cout << i + 1 << " " << c + 1 << endl;
                e[i] = 1 - e[i];
            }
            else{
                cout << c + 1 << " " << i + 1 << endl;
                e[c] = 1 - e[c];
            }
            s[i]--;
            s[c]--;
            if(s[c] == 1){
                que.push(c);
                while(que.size()){
                    int now = que.front();
                    que.pop();
                    int cnow;
                    int lg = v[now].size();
                    for(int j = 0; j < lg; j++){
                        if(v[now][j] != INF){
                            cnow = v[now][j];
                            v[now][j] = INF;
                            break;
                        }
                    }
                    int lth = v[cnow].size();
                    for(int j = 0; j < lth; j++){
                        if(v[cnow][j] == now){
                            v[cnow][j] = INF;
                            break;
                        }
                    }
                    if(e[now]){
                        s[now]--;
                        s[cnow]--;
                        e[now] = 1 - e[now];
                        cout << now + 1 << " " << cnow + 1 << endl;
                    }
                    else{
                        s[now]--;
                        s[cnow]--;
                        e[cnow] = 1 - e[cnow];
                        cout << cnow + 1 << " " << now + 1 << endl;

                    }
                    if(s[cnow] == 1) que.push(cnow);
                }
            }
        }
    }
}

Measured memory_bytes: 15360