#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;
const int N = 1e5+3;
vector <pair <int,int> > adj[N];
int deg[N];
bool used[N];
int size[N], dir[N];
int n, m;
pair<int, int> edge[N];

void dfs(int u)
{
	used[u] = true;
	size[u] = deg[u];
	for(auto i:adj[u])
	{
		if(!used[i.fi])
		{
			dfs(i.fi);
			if(size[i.fi] % 2 == 1)
			{
				dir[i.se]^=1;
			}
			size[u] += size[i.fi];
		}
	}
}


int main()
{
	int res = 1;
	cin >> n >> m;
	for(int i=1;i<=m;i++)
	{
		int x, y;
		cin >> x >> y;
		deg[x]^=1;
		adj[x].push_back({y, i});
		adj[y].push_back({x, i});
		edge[i]={x,y};
	}
	
	if(m % 2 == 1)
		return cout <<-1, 0;
	dfs(1);
	for(int i=1;i<=m;i++)
	{
		if(dir[i] == 0)
			cout << edge[i].fi << ' ' << edge[i].se << '\n';	
		else
			cout << edge[i].se << ' ' << edge[i].fi << '\n';
					
	}
	
}