#pragma once
#include <stdio.h>
#include <sstream>
#include <string>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <limits>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define bit(x,v) ((ll)x << v)

const ll INF = 1000000007;
const int MAX = 210000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
int pr[100010];
void uini(int n) {
	for (size_t i = 0; i <= n; i++)
	{
		pr[i] = i;
	}
}

int parent(int x) {
	if (x == pr[x]) return x;
	return pr[x] = parent(pr[x]);
}

bool unit(int x, int y) {
	int px = parent(x);
	int py = parent(y);

	if (px == py) return false;
	if (px < py) {
		pr[py] = px;
	}
	else {
		pr[px] = py;
	}
	return true;
}

ll memo[100010];
int a[100010];
int n, m;

ll calc(int x) {
	if (a[x] == 1) return 0;
	if (x > n) return 0;
	if (x == n) return 1;
	ll& res = memo[x];
	if (~res) return res;
	res = 0;
	res += calc(x + 1);
	res %= INF;
	res += calc(x + 2);
	res %= INF;
	return res;
}

int buttle(ll a,ll b,ll aa,ll bb){
	ll ab = max(1LL,a / bb);
	ll aab = max(1LL,aa / b);
	if (ab == aab) {
		ll ar = a - ab * bb;
		ll aar = aa - aab * b;
		if (ar > 0 && aar > 0) return 0;
		if (ar <= 0 && aar <= 0) return 0;
		if (ar <= 0) return -1;
		if (aar <= 0) return 1;
	}

	if (ab > aab) {
		return 1;
	}
	else if (ab < aab)
		return -1;
	else return 0;

}
struct edge {
	int ind, f, t;
	edge(int _ind, int _f, int _t) :ind(_ind), f(_f), t(_t) {}
};
queue<edge> ed[100010];
pair<int, int> e[100010];
bool use[100010];
int ocount[100010];
int ucount[100010];
int mcount[100010];
void rec(int x,int ind) {

	int ecount = 0;
	while (!ed[x].empty()) {
		edge p = ed[x].front();
		ed[x].pop();
		int nex = p.t;
		int ni = p.ind;
		if (use[ni]) continue;
		use[ni] = true;
		ucount[x]++;
		ucount[nex]++;
		
		mcount[x]++;
		if (e[ni].first != x) swap(e[ni].first, e[ni].second);
		if (ucount[x] == ocount[x]) {
			if (mcount[x] % 2 != 0) {
				if (e[ni].first == x) swap(e[ni].first, e[ni].second);
				mcount[x]--;
				mcount[nex]++;
			}
		}
		rec(nex,  ni);
		ecount++;
	}

	if (mcount[x] % 2 != 0) {
		if (e[ind].first != x) {

			swap(e[ind].first, e[ind].second);
		}
		mcount[e[ind].first]++;
		mcount[e[ind].second]--;
	}
}
void solv() {
	int n,m;
	cin >> n >> m;

	for (size_t i = 0; i < m; i++)
	{
		int a, b;
		cin >> a >> b;
		ed[a].push(edge(i,a,b));
		ed[b].push(edge(i,b,a));
		e[i] = make_pair(a, b);
	}

	if (m % 2 != 0) {
		cout << -1 << endl;
		return;
	}

	rec(1, -1);

	for (size_t i = 0; i < m; i++)
	{
		cout << e[i].first << " " << e[i].second << endl;
	}

}

int main() {
	//COMinit();
	solv();

	return 0;
}
 

Measured memory_bytes: 77952