#include<bits/stdc++.h>
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#define for1(i,l,r) for(int i=(l);i<(r);i++)
#define for2(i,l,r) for(int i=(l);i>(r);i--)
using namespace std;
int n,m,u,v,root,le;
vector<vector<pair<int,int> > > r;
vector<pair<int,int> > ans;
int cnt[100006],vis[100006],out[100006];
void dfs(int u){
	vis[u]=true;
	cnt[u]+=out[u];
	for(int i=0;i<r[u].size();i++){
		int x=r[u][i].first,y=r[u][i].second;
		if(!vis[x]){
			dfs(x);
			cnt[u]+=cnt[x];
			cnt[u]%=2;
			if(cnt[x]%2==1) swap(ans[i].first,ans[i].second);
		}
	}
}
signed main(){
//	freopen(".inp","r",stdin);
//	freopen(".out","w",stdout);
//	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin>>n>>m;
	r.assign(n+1,vector<pair<int,int> >());
	for(int i=0;i<m;i++){
		cin>>u>>v;
		out[u]++;
		r[u].push_back({v,i});
		r[v].push_back({u,i});
		ans.push_back({u,v});
	}
	for(int i=1;i<=n;i++){
		out[i]%=2;
		if(out[i]) le++;
	}
	if(le%2==1){
		cout<<-1;
		return 0;
	}
	dfs(1);
	for(int i=0;i<n;i++) cout<<ans[i].first<<" "<<ans[i].second<<endl;
}
