//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}

struct edge {
    int to;
    int64_t cost;
    edge(int x=0, int64_t y=0):to(x), cost(y) {}
};

vector<vector<edge> > G; // resizeの必要あり


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    G.resize(n);
    vector<P> num(n);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].emplace_back(b, G[b].size());
        G[b].emplace_back(a, G[a].size()-1);
        num[a].first++;
        num[b].first++;
    }
    if(m&1) {
        cout << -1 << endl;
        return 0;
    }

    vvi spt(n);
    vector<P> ans;
    queue<int> q;
    q.emplace(0);
    vector<bool> check(n);
    check[0] = true;
    while(!q.empty()) {
        int now = q.front();
        q.pop();
        for(edge e:G[now]) {
            int ne = e.to;
            if(ne == -1) continue;
            if(check[ne]) {
                ans.emplace_back(now+1, ne+1);
                num[now].first--;
                num[ne].first--;
                num[now].second++;
                G[ne][e.cost].to = -1;
            } else {
                G[ne][e.cost].to = -1;
                check[ne] = true;
                spt[now].push_back(ne);
                spt[ne].push_back(now);
                q.push(ne);
            }
        }
    }

    rep(i, n) {
        if(num[i].first == 1 and i) {
            q.push(i);
            check[i] = false;
        }
    }
    while(!q.empty()) {
        int now = q.front();
        q.pop();
        for(int nw:spt[now]) {
            if(!check[nw] or nw == 0) continue;
            else {
                if(num[nw].first == 2) {
                    num[nw].first--;
                    if(num[now].second&1) {
                        ans.emplace_back(now+1, nw+1);
                    } else {
                        ans.emplace_back(nw+1, now+1);
                        num[nw].second++;
                    }
                    check[nw] = false;
                    q.push(nw);
                } else {
                    num[nw].first--;
                    if(num[now].second&1) {
                        ans.emplace_back(now+1, nw+1);
                    } else {
                        ans.emplace_back(nw+1, now+1);
                        num[nw].second++;
                    }
                }
            }
        }
    }
    for(int ne:spt[0]) {
        if(num[ne].second&1) {
            ans.emplace_back(ne+1, 1);
        } else {
            ans.emplace_back(1, ne+1);
        }
    }

    rep(i, m) {
        cout << ans[i] << '\n';
    }
}

Measured memory_bytes: 18148