#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <bitset>
#include <complex>
#include <unistd.h>
#include <cassert>
#include <cctype>
#include <random>
#include <time.h>
#define _USE_MATH_DEFINES
#define _GLIBCXX_DEBUG
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
typedef complex<double> xy_t;
typedef vector<ll> vll;
typedef vector< vector<ll> > matrix;
#define REP(i, x, y) for(ll i = (ll)x; i < (ll)y; i++)
#define DREP(i, x, y, d) for(ll i = (ll)x; i < (ll)y; i += (ll)d)
#define PER(i, x, y) for(ll i = (ll)x; i > (ll)y; i--)
#define DPER(i, x, y, d) for(ll i = (ll)x; i > (ll)y; i -= (ll)d)
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;
int iinf = intmax / 8;
ll inf = llmax / 8;
double eps = 1e-12;

struct edge {
    ll to, cost;
};

int V;
vector<edge> G[1000000];
ll d[1000000];

void addedge(int st, int ed, ll co) {
    edge e;
    e.to = ed;
    e.cost = co;
    G[st].push_back(e);
}

//根付き木を作る。parentVectorに親nodeの番号が入る。
//parentVector[root] = -1
vector<ll> par;
void makeRootedTree(vector<ll> &parentVector, ll root) {
    assert(root < (ll)parentVector.size());
    parentVector[root] = -1;
    queue<ll> que;
    que.push(root);
    while (!que.empty()) {
        ll node = que.front();
        que.pop();
        REP (i, 0, G[node].size()) {
            edge e = G[node][i];
            if (e.to != parentVector[node]) {
                parentVector[e.to] = node;
                que.push(e.to);
            }
        }
    }
}

bool even[100010];
vector<plglg> ans;

//根付き木の葉から根に向かって何か処理をする
void leafToRoot(vector<ll> &parentVector, ll root) {
    queue<ll> que;
    vector<ll> used(V);
    fill(used.begin(), used.end(), 0);
    REP(i, 0, V) {
        if (i != root && G[i].size() == 1) {
            que.push(i);
            used[i] = 1;
        }
    }
    while (!que.empty()) {
        ll node = que.front();
        que.pop();
        if (node == root) {
            break;
        }
        ll parent = parentVector[node];
        used[parent]++;

        if (even[node]) {
            ans.push_back(plglg(parent, node));
            even[parent] = !even[parent];
        } else {
            ans.push_back(plglg(node, parent));
        }

        if ((parent == root && used[parent] == (ll)G[parent].size()) ||
            (parent != root && used[parent] == (ll)G[parent].size() - 1)) {
            que.push(parent);
        }
    }
}

struct unionFind {
    vector<int> data;
    unionFind(int size) : data(size, -1) {}
    
    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x != y) {
            if(data[y] < data[x]) {
                swap(x, y);
            }
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    int root(int x) {
        return (data[x] < 0) ? x : data[x] = root(data[x]);
    }

    int rank(int x) {
        return -data[root(x)];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    V = N;
    par = vector<ll>(N);
    unionFind u(N);
    fill(even, even + N, true);
    REP(i, 0, M) {
        ll a, b;
        cin >> a >> b;
        if (!u.same(a - 1, b - 1)) {
            addedge(a - 1, b - 1, 1);
            addedge(b - 1, a - 1, 1);
            u.unite(a - 1, b - 1);
        } else {
            ans.push_back(plglg(a - 1, b - 1));
            even[a - 1] = !even[a - 1];
        }
    }
    if (M & 1) {
        cout << -1 << endl;
        return 0;
    }
    makeRootedTree(par, 0);
    leafToRoot(par, 0);
    REP(i, 0, M) {
        cout << ans[i].first + 1 << " " << ans[i].second + 1 << endl;
    }
}


Measured memory_bytes: 35320