#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<queue>
using namespace std;

typedef long long ll;
typedef vector <ll> v_ll;
typedef vector <vector <ll> > vv_ll;
typedef vector < pair <ll,ll> > vp_ll;
typedef pair <ll,ll> p_ll;

bool TEST=false;
ll MOD = 1000000007;

void show(){if (TEST){cout << endl;}}
void show(string x){if (TEST){cout << x;}}
void show(string x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(ll x){if (TEST){cout << x;}}
void show(ll x,bool enter){
  if (TEST){if (enter) cout << "<#> " << x << endl;else cout << x;}
}
void show(p_ll p){
  if (TEST){cout << "{ ";show(p.first);cout << " ";show(p.second);cout << " }";}
}
void show(v_ll v){
  if (TEST){
    cout << "<begin> ";
    for (ll i=0;i<v.size();i++){show(v[i]); cout << " ";}cout <<"<end>"<< endl;
}}
void show(vv_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}
void show(vp_ll v){
  if (TEST){
    cout << "//////////" << endl;
    for (ll i=0;i<v.size();i++){
      show(v[i]); cout << endl;
}}}

ll mod(ll x){
  ll n=MOD;
  ll ret=x%n;
  if (ret<0)ret+=n;
  return ret;
}
void mod_self(ll &x){
  x=mod(x);
}
ll mod_inv(ll x){
  ll n=MOD;
  ll y = x,z = n-2, ret=1;
  y=mod(y);
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  return ret;
}
ll mod_pow(ll x,ll a){
  ll y = x,z = a,ret=1;
  y=mod(y);
  if (z<0)z=-z;
  while (z>0){
    if(z%2==1) ret=mod(ret*y);
    y=mod(y*y);
    z/=2;
  }
  if (a<0) ret=mod_inv(ret);
  return ret;
}
v_ll mod_nck(ll n){
  v_ll nck(n+1,0);
  nck[0]=1;
  for (ll i=1;i<=n;i++){
    nck[i]=mod(nck[i-1]*(n+1-i));
    nck[i]=mod(nck[i]*mod_inv(i));
  }
  return nck;
}
v_ll mod_factorial(ll n){
  v_ll fct(n+1,0);
  fct[0]=1;
  for (ll i=1;i<=n;i++){
    fct[i]=mod(fct[i-1]*i);
  }
  return fct;
}

ll get_pair(ll &x,p_ll &y){
  return y.second==x?y.first:y.second;
}


ll N,M;
v_ll A;
v_ll F;
v_ll O;
vv_ll G,G2;
vp_ll E;
int main(){
  cin >> N >> M;
  G=vv_ll(N+10,v_ll());
  G2=vv_ll(N+10,v_ll());
  A.assign(N+M+10,0);
  F.assign(N+M+10,0);
  O.assign(N+M+10,0);
  E.assign(N+M+10,p_ll(0,0));

    ll a,b;
  for (ll k=1;k<=M;k++){
    cin >> a >> b;
    E[k]=p_ll(a,b);
    G[a].push_back(b);
    G[b].push_back(a);
    G2[a].push_back(k);
    G2[b].push_back(k);
    O[a]++;
    O[a]%=2;
  }
  if (M%2==1){
    cout << -1 << endl;
    return 0;
  }
  queue<ll> que;
  que.push(1);
  while (!que.empty()){
    ll f=que.front();
    que.pop();
    for (ll i=0;i<G[f].size();i++){
      ll mvto=abs(G[f][i]);
      if (A[mvto]==0){
        A[mvto]=1;
        F[mvto]=G2[f][i];
        que.push(mvto);
      }
    }
  }
  //printf("hoge");
  //TEST=true;
  //show(O);
  //fflush(stdout);

  for (ll i=2;i<=N;i++){
    if (O[i]==1){
      ll idx=i;

      bool sw=false;
      while (idx!=1){
        //cout << idx << endl;
        if (O[idx]==1)sw=!sw;
        //cout << idx << sw << endl;
        O[idx]=0;

        if (sw){
          swap(E[F[idx]].first,E[F[idx]].second);
        }
        ll nidx=E[F[idx]].first;
        if (nidx==idx) nidx=E[F[idx]].second;
        idx=nidx;
      }
    }
  }
  for (ll i=1;i<=M;i++){
    cout << E[i].first << " " << E[i].second << endl;
  }

}


Measured memory_bytes: 22144