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

vector<pair<int, int> > adj[100005];
pair<int, int> edge[100005];
bool dir[100005];
bool used[100005];
int deg[100005];
int sz[100005];
void dfs(int node)
{
	used[node]=true;
	sz[node]+=deg[node];
	for(auto i:adj[node])
	{
		if(!used[i.first])
		{
			dfs(i.first);
			if(sz[i.first]%2==1)
			{
				dir[i.second]^=1;
			}
			sz[node]+=sz[i.first];
		}
	}
}

signed main()
{
	int n, m;
	cin>>n>>m;
	for(int i=1; i<=m; i++)
	{
		int u, v;
		cin>>u>>v;
		edge[i]={u,v};
		deg[u]++;
		adj[u].pb({v,i});
		adj[v].pb({u,i});
	}
	int cut=0;
	for(int i=1; i<=n; i++)
	{
		deg[i]%=2;
		if(deg[i]==1)
		{
			cut++;
		}
	}
	if(cut%2==1)
	{
		cout<<-1;
		return 0;
	}
	dfs(1);
	for(int i=1; i<=m; i++)
	{
		if(dir[i])
		{
			cout<<edge[i].second<<" "<<edge[i].first<<endl;
		}
		else
		{
			cout<<edge[i].first<<" "<<edge[i].second<<endl;
		}
	}
}