#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#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 all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = 1'000'000'007;
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 (b < a) { a = b; return true; } return false; }

template<typename T>
vector<T> gen_v(size_t a) { return vector<T>(a); }
template<typename T, typename ...Ts>
auto gen_v(size_t a, Ts... ts) { return vector<decltype(gen_v<T>(ts...))>(a, gen_v<T>(ts...)); }
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T &t, const V &v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, M; cin >> N >> M;
	vector<int> deg(N);
	vector<set<int>> G(N);
	vector<int> A(M), B(M); rep(i, 0, M) {
		cin >> A[i] >> B[i];
		A[i]--, B[i]--;
		deg[A[i]]++, deg[B[i]]++;
		G[A[i]].insert(B[i]);
		G[B[i]].insert(A[i]);
	}

	using T = tuple<int, int, int>;
	priority_queue<T, vector<T>, greater<T>> pq;
	rep(i, 0, N) {
		pq.emplace(deg[i], 0, i);
	}

	vector<int> out(N);
	vector<pair<int, int>> ans;
	while (pq.size()) {
		int d, o, u; tie(d, o, u) = pq.top(); pq.pop();

		if (d == 0)continue;
		if (G[u].size() != d || out[u] != o)continue;

		dump(d, o, u);

		int a = *G[u].begin();
		G[u].erase(a);
		G[a].erase(u);

		if (o % 2 == 0) {
			out[a] = !out[a];
			ans.emplace_back(a, u);
		}
		else {
			out[u] = !out[u];
			ans.emplace_back(u, a);
		}
		pq.emplace(G[a].size(), out[a], a);
		pq.emplace(G[u].size(), out[u], u);

	}
	assert(42500 < N && N <= 46000);
	bool ok = true;
	rep(i, 0, N)if (out[i] % 2)ok = false;
	if (ok && ans.size() == M) {
		for (auto x : ans) {
			cout << x.first + 1 << " " << x.second + 1 << endl;
		}
	}
	else {
		cout << -1 << endl;
	}


	return 0;
}