#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
#define MP make_pair
#define PB push_back
#define ll long long
#define int long long
#define f(i,x,n) for(int i=x;i<n;i++)
#define ld long double
#define mod 1000000007

int n,m;
vector <pair <int,int> > gp[100005];
int va[100005],su;
int vis[100005];
vector <pair <int,int> > ans;
int dfs(int i,int par)
{
	if(vis[i]==1)
		return 0;
	vis[i]=1;
	int vaa=va[i];
	for(auto &j: gp[i])
	{
		int tem=dfs(j.ff,i);
		j.ss^=tem;
		vaa^=tem;
	}
	for(auto &j: gp[i])
	{
		if(j.ff==par)
		{
			j.ss^=vaa;
		}
	}
	return vaa;
}
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin>>n>>m;
	f(i,0,m)
	{
		int a,b;
		cin>>a>>b;
		gp[a].push_back({b,1});
		va[a]^=1;
		gp[b].push_back({a,0});
	}
	if(m%2!=0)
	{
		cout<<"-1\n";
		return 0;
	}
	dfs(1,0);
	f(i,1,n+1)
	{
		for(auto j: gp[i])
		{
			if(j.ss==1)
				cout<<i<<" "<<j.ff<<'\n';
		}
	}
	return 0;
}