#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
	#define D(x...) printf(x)
#else
	#define D(x...)
#endif
typedef long long ll;
int n, m, seen[100010], sign[100010];
vector<int> adj[100010];
vector<pair<int, int> > dfsadj[100010];
vector<pair<int, int> > other;
void dfs(int a)
{
	seen[a] = 1;
	for (auto b : adj[a])
	{
		if (seen[b] == 1) continue;
		else if (seen[b]) sign[a] = !sign[a], other.emplace_back(a, b);
		else dfs(b), sign[a] = !sign[a], dfsadj[a].emplace_back(b, 0);
	}
	seen[a] = 2;
}	
int dfs2(int a)
{
	for (auto &b : dfsadj[a])
	{
		if (dfs2(b.first))
		{
			b.second = 1;
			sign[a] = !sign[a];
		}
	}
	return sign[a];
}
int main()
{
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; i++)
	{
		int a, b;
		scanf("%d%d", &a, &b);
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs(1);
	if (dfs2(1)) printf("-1\n");
	else 
	{
		for (int i = 1; i <= n; i++)
		{
			for (auto a : dfsadj[i])
			{
				if (a.second) printf("%d %d\n", a.first, i);
				else printf("%d %d\n", i, a.first);
			}
		}
		for (auto a : other) printf("%d %d\n", a.first, a.second);
	}
}