#include <bits/stdc++.h>
using namespace std;

const int NMAX = 100010;
vector <int> adia[NMAX];
int h[NMAX];
vector <int> fii[NMAX];
vector <pair <int, int>> ans;
bool ok = 1;

void dfs(int nod)
{
	vector <int> sus;
	for (auto i : adia[nod]) {
		if (!h[i]) {
			h[i] = 1 + h[nod];
			dfs(i);
		}
		if (h[i] < h[nod])
			sus.push_back(i);
	}
	while (fii[nod].size() >= 2) {
		int a = fii[nod].back();
		fii[nod].pop_back();
		int b = fii[nod].back();
		fii[nod].pop_back();
		ans.push_back({ nod, a });
		ans.push_back({ nod, b });
	}
	
	if (!fii[nod].empty()) {
		if (sus.empty()) {
			ok = 0;
			return;
		}
		int a = fii[nod][0];
		int b = sus.back();
		sus.pop_back();
		ans.push_back({ nod, a });
		ans.push_back({ nod, b });
	}
	
	for (auto i : sus)
		fii[i].push_back(nod);
}

int main()
{
	int n, m, a, b;
	scanf("%d%d", &n, &m);
	
	while (m--) {
		scanf("%d%d", &a, &b);
		adia[a].push_back(b);
		adia[b].push_back(a);
	}
	
	h[1] = 1;
	dfs(1);
	
	if (!ok) {
		cout << "-1\n";
		return 0;
	}
	
	for (auto i : ans)
		cout << i.first << ' ' << i.second << '\n';
	
	return 0;
}
