#include <iostream>
#include <vector>

using namespace std;

int n, m;
vector<pair<int,int>> e;
vector<pair<int,int>> v[101010];
int d[101010];
int z[101010];
int b[101010];

int dfs(int x) {
	z[x] = 1;
	int r = 0;
	for (auto u : v[x]) {
		if (z[u.first]) continue;
		int h = dfs(u.first);
		if (h) b[u.second] = 1-b[u.second];
		r += h;
	}
	if (d[x]%2 == 1) r++;
	return r%2;
}

int main() {
	cin >> n >> m;
	if (m%2 == 1) {
		cout << "-1\n";
		return 0;
	}
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		e.push_back({a,b});
		d[a]++;
		v[a].push_back({b,i});
		v[b].push_back({a,i});
	}
	dfs(1);
	for (int i = 0; i < m; i++) {
		if (b[i]) swap(e[i].first,e[i].second);
		cout << e[i].first << " " << e[i].second << "\n";
	}
}
