#include <iostream>
#include <vector>
using namespace std;

int c[100009];
bool vs[100009], evs[100009];
vector<pair<int, int> > v[100009], ans;

void dfs(int n)
{
	vs[n] = true;
	for (int i = 0; i < v[n].size(); i++) {
		int ei = v[n][i].second;
		if (evs[ei]) continue;
		evs[ei] = true;
		int tn = v[n][i].first;
		if (vs[tn]) {
			ans.push_back(make_pair(n, tn));
			c[n]++;
			continue;
		}
		dfs(tn);
		if (c[tn] % 2) 
			ans.push_back(make_pair(tn, n));
		else {
			ans.push_back(make_pair(n, tn));
			c[n]++;
		}
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m; cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		v[a].push_back(make_pair(b, i)); v[b].push_back(make_pair(a, i));
	}
	if (m % 2) {
		cout << -1 << '\n';
		return 0;
	}
	dfs(1);
	for (int i = 0; i < m; i++)
		cout << ans[i].first << " " << ans[i].second << '\n';
	return 0;
}