#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define DSRNG(i,is,ie) for (long long i=(is), i##_end=(ie); i>=i##_end; i--)
#define UNIQUE(v) { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); }
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return true;} return false; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return true;} return false; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) { cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl; }
template<class T> T gcd(const T &a, const T &b) { return a < b ? gcd(b, a) : b ? gcd(b, a % b) : a; }
template<class T> T lcm(const T &a, const T &b) { return a / gcd(a, b) * b; }

// gcc拡張マクロ
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// 処理内容
int main() {
    
    ll n, m; cin >> n >> m;
    vector<vector<ll>> g(n, vector<ll>());
    vector<vector<pair<ll, bool>>> dg(n, vector<pair<ll, bool>>()); // {to, out?}
    vector<ll> indeg(n, 0), outdeg(n, 0);
    REP(i, m) {
        ll a, b; cin >> a >> b;
        a--; b--; // 0-indexed
        g[a].push_back(b);
        g[b].push_back(a);
        dg[a].emplace_back(b, true);
        dg[b].emplace_back(a, false);
        outdeg[a]++;
         indeg[b]++;
    }
    REP(i, n) sort(ALL_OF(dg[i]));

    vector<bool> tobemod(n);
    REP(i, n) tobemod[i] = outdeg[i] & 1;
    if (accumulate(ALL_OF(tobemod), 0LL) & 1) {
        cout << -1 << endl;
        return 0;
    }

    vector<ll> rank; rank.reserve(n);
    vector<ll> depth(n, -1);
    {
        deque<ll> q = {0};
        rank.push_back(0);
        depth[0] = 0;
        while (q.size()) {
            ll u = q.front(); q.pop_front();
            for (ll v : g[u]) {
                if (depth[v] == -1) {
                    depth[v] = depth[u] + 1;
                    q.push_back(v);
                    rank.push_back(v);
                }
            }
        }
    }

    REP(_i, n) {
        ll i = rank[n-1-_i];
        // DUMP(i);
        if (!tobemod[i]) continue;

        for (ll j : g[i]) {
            if (depth[j] < depth[i]) {
                (*lower_bound(ALL_OF(dg[i]), pair<ll, bool>(j, false))).second ^= 1;
                (*lower_bound(ALL_OF(dg[j]), pair<ll, bool>(i, false))).second ^= 1;
                tobemod[j] = !tobemod[j];
                tobemod[i] = !tobemod[i];
                break;
            }
        }

    }

    REP(i, n) {
        for (const auto &u : dg[i]) {
            if (u.second) {
                cout << i + 1 << " " << u.first + 1 << endl;
            }
        }
    }
    
}

Measured memory_bytes: 18048