#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<vector>
const int maxn=1e5+1000;
using namespace std;
int n,m,fa[maxn],out[maxn];
vector<int>side[maxn];
int get(int x){
	if(fa[x]==x)return x;
	fa[x]=get(fa[x]);
	return fa[x];	
}
void uni(int x,int y){
	fa[get(x)]=get(y);	
}
void dfs(int now,int fa){
	for(int i=0;i<side[now].size();i++){
		int v=side[now][i];if(v==fa)continue;
		dfs(v,now);
		if(out[v]&1){printf("%d %d\n",v,now);}
		else{out[now]++;printf("%d %d\n",now,v);}	
	}
	return;
}
int main(){
	scanf("%d%d",&n,&m);
	if(m&1){printf("-1");return 0;}
	for(int i=1;i<=n;i++)fa[i]=i;
	for(int i=1;i<=m;i++){
		int u,v;scanf("%d%d",&u,&v);
		if(get(u)!=get(v)){side[u].push_back(v);side[v].push_back(u);uni(u,v);}
		else{
			out[v]++;
			printf("%d %d\n",v,u);
		}
	}
	dfs(1,0);
	return 0;
}