#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>
#include <time.h>
#include <random>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll,ll> P;
 
long long int INF = 3e18;
double Pi = 3.1415926535897932384626;
 
vector<ll> G1[500005];
vector<ll> G2[500005];
//vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←
 
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
 
 
ll mod = 1000000007;
ll rui(ll number1,ll number2){
 
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
 
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
 
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
 
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

 
//ll fact[800005],rfact[800005];
/*
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<=800000; i++){
        fact[i] = (fact[i-1]*i) % mod;
    }
    rfact[800000] = rui(fact[800000],mod - 2);
    for(ll i=800000; i>=1; i--){
       rfact[i-1] = rfact[i] * i;
       rfact[i-1] %= mod;
    }
    return;}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;}
*/
 
ll n,m,num,sum,ans,a,b,c,e,g,h,w,i,j,k,q;
ll x[500005],y[500005],z[500005];
P table[500005];
ll d[500005],even[500005];
ll swap_count[500005];
ll odd_count_memo[500005];
bool check[500005];

void dfs(ll v){
    check[v] = true;
    for(int i=0;i<G1[v].size();i++){
        ll nv = G1[v][i];
        if(check[nv])continue;
        G2[v].pb(nv);
        G2[nv].pb(v);
        dfs(nv);
    }
    return;
}

ll table_search(ll a,ll b){
    ll idx = lb(table,table+m,P(a,b)) - table;
    if(table[idx].first == a && table[idx].second == b){
        return idx;
    }else{
        return table_search(b,a);
    }
}
ll count_odd(ll v,ll p){
    ll sum = 0;
    if(odd_count_memo[v] != -1){
        return odd_count_memo[v];
    }
    if(even[v] % 2 == 1)sum += 1;
    for(int i=0;i<G2[v].size();i++){
        ll nv = G2[v][i];
        if(nv == p)continue;
        sum += count_odd(nv,v);
    }
    odd_count_memo[v] = sum;
    return sum;
}
void solve_dfs(ll v,ll p){
    //pe("solve = ");pe(v);p(p);
    for(int i=0;i<G2[v].size();i++){
        ll nv = G2[v][i];
        if(nv == p)continue;
        if(count_odd(nv,v) % 2 == 1){
            ll idx = table_search(nv,v);
            swap_count[idx]++;
            solve_dfs(nv,v);
        }else{
            solve_dfs(nv,v);
        }
    }
    return;
}



int main(){
    cin >> n >> m;
    for(i=1;i<=n;i++){
        odd_count_memo[i] = -1;
    }
    for(i=0;i<m;i++){
        cin >> a >> b;
        table[i].first = a;
        table[i].second = b;
        G1[a].pb(b);
        G1[b].pb(a);
        even[a]++;
    }
    sort(table,table+m);
    if(m % 2 == 1){
        p(-1);
        return 0;
    }
    //全域木を構成
    dfs(1);
    solve_dfs(1,-1);
    for(int i=0;i<m;i++){
        a = table[i].first;
        b = table[i].second;
        if(swap_count[i] % 2 == 1){
            //pe("frip edge = ");p(i);
            swap(a,b);
        }
        pe(a);p(b);
    }
    
    return 0;
}












Measured memory_bytes: 47232