#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

using Weight = int;
using Flow = int;
struct Edge {
	int s, d; Weight w; Flow c; int id;
	int dir = 0;
	Edge() {};
	Edge(int s, int d, Weight w = 1) : s(s), d(d), w(w), c(w) {};
};
bool operator<(const Edge &e1, const Edge &e2) { return e1.w < e2.w; }
bool operator>(const Edge &e1, const Edge &e2) { return e2 < e1; }
inline ostream &operator<<(ostream &os, const Edge &e) { return (os << '(' << e.s << ", " << e.d << ", " << e.w << ')'); }

using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

void addArc(Graph &g, int s, int d, Weight w = 1) {
	g[s].emplace_back(s, d, w);
}
void addEdge(Graph &g, int a, int b, Weight w = 1) {
	addArc(g, a, b, w);
	addArc(g, b, a, w);
}
struct UnionFind {
	vector<int> parent;
	int size;
	UnionFind(int n) :parent(n, -1), size(n) {}
	bool unite(int x, int y) {
		x = root(x); y = root(y);
		if (x == y)return false;
		if (size_of(x) < size_of(y))swap(x, y);
		parent[x] += parent[y]; parent[y] = x; size--;
		return true;
	}
	bool same(int x, int y) { return root(x) == root(y); }
	int root(int x) { return parent[x] < 0 ? x : parent[x] = root(parent[x]); }
	int size_of(int x) { return -parent[root(x)]; }
};

pair<Edges,Edges> kruskal(int N, vector<Edge> &edges) {
	int totalCost = 0;
	sort(all(edges));
	UnionFind dset(N);
	vector<Edge>mst;
	vector<Edge>other;
	rep(i, 0, edges.size()) {
		Edge e = edges[i];
		if (!dset.same(e.s, e.d)) {
			mst.push_back(e);
			totalCost += e.w;
			dset.unite(e.s, e.d);
		}
		else {
			e.dir = 1;
			other.emplace_back(e);
		}
	}
	return make_pair(mst, other);
}



signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N, M; cin >> N >> M;
	Edges es;
	rep(i, 0, M) {
		int a, b; cin >> a >> b;
		a--, b--;
		es.emplace_back(a, b);
	}
	if (M % 2 == 1) {
		cout << -1 << endl;
		return 0;
	}
	auto p = kruskal(N, es);
	int root = 0;
	auto mst = p.first;
	auto other = p.second;
	dump(mst);
	dump(other);

	Graph tree(N);
	for (auto e : mst) {
		addEdge(tree, e.s, e.d);
	}
	vector<int>outdeg(N);
	for (auto e : other) {
		outdeg[e.s]++;
	}
	dump(outdeg);

	function<void(int, int)>dfs = [&](int cur, int par) {

		for (auto e : tree[cur]) {
			if (e.d == par)continue;
			dfs(e.d, cur);
		}

		for (auto e : tree[cur]) {
			if (e.d == par) {
				e.dir = (outdeg[cur] % 2 == 1 ? 1 : 0);
				outdeg[cur] += e.dir;
				other.eb(e);
				if (e.dir == 0) {
					outdeg[e.d]++;
				}
				
			}
		}
	};
	dfs(0, -1);
	dump(outdeg);
	assert(other.size() == M);

	vector<int>tmp(N);

	for (auto e : other) {
		if (e.dir) {
			cout << e.s + 1 << " " << e.d + 1 << endl;
			tmp[e.s]++;
		}
		else {
			cout << e.d + 1 << " " << e.s + 1 << endl;
			tmp[e.d]++;
		}
	}

	rep(i, 0, N) {
		assert(tmp[i] % 2 == 0);
	}




	return 0;
}


Measured memory_bytes: 53524