#include <bits/stdc++.h>
using namespace std;
						
#define fast_cin() ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define endl '\n'
#define int long long

const int N = 1e5 + 5;

int a[N], b[N], out_degree[N];
vector<pair<int, int>> g[N];
vector<bool> seen(N, false);

void dfs(int u, int id);
				
int32_t main() {
	fast_cin();  
	int n, m; cin >> n >> m;
	if (m & 1) {
		cout << -1 << endl;
		return 0;
	}
	for (int i = 1; i <= m; ++i) {
		cin >> a[i] >> b[i];
		g[a[i]].push_back({b[i], i});
		g[b[i]].push_back({a[i], i});
		++out_degree[a[i]];
	}
	dfs(1, 0);
	for (int i = 1; i <= m; ++i) {
		cout << a[i] << " " << b[i] << endl;
	}
}

void dfs(int u, int id) {
	seen[u] = true;
	for (auto &e : g[u]) {
		auto [v, n_id] = e;
		if (!seen[v]) {
			dfs(v, n_id);
		}
	}
	if (out_degree[u] & 1) {
		assert(id != 0);
		--out_degree[a[id]], ++out_degree[b[id]];
		swap(a[id], b[id]);
	}
}