#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
vector<pair<int,int> > g[N];
int vis[N],d[N];
set<pair<int,int> > s;
void dfs(int u){
    vis[u] = 1;
    for(auto i : g[u]){
        int v = i.first;
        if(vis[v]==0) dfs(v), d[u] ^= d[v];
    }
}
void solve(int u){
    vis[u] = 1;
    for(auto i : g[u]){
        int v = i.first;
        if(vis[v]) continue;
        if(i.second==d[v]) cout<<u<<' '<<v<<endl;
        else cout<<v<<' '<<u<<endl;
        if(i.second==0) s.erase(make_pair(u,v));
        else s.erase(make_pair(v,u));
        solve(v);
    }
}
int main(){
    int n,m; cin>>n>>m;
    for(int i=1;i<=m;i++){
        int u,v; cin>>u>>v;
        g[u].push_back(make_pair(v,0));
        g[v].push_back(make_pair(u,1));
        s.insert(make_pair(u,v));
        d[u] ^= 1;
    }
    if(m&1) cout<<-1<<endl;
    else{
        dfs(1);
        memset(vis,0,sizeof(vis));
        solve(1);
        for(auto x : s){
            cout<<x.first<<' '<<x.second<<endl;
        }
    }
}
