#include<bits/stdc++.h>
using namespace std;

#define LL long long
#define lowbit(x) (x&-x)
#define PLL pair<LL,LL>
#define PII pair<int,int>
namespace FastIO_{
    template<typename T> T read(){
        T x=0;int f=1;char c=getchar();
        while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
        while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();
        return x*f;
    }
    template<typename T> void _print(T x){
        if(x>9) _print(x/10);
        putchar(x%10+'0');
    }
    template<typename T> void  print(T x,char c){
        if(x<0) putchar('-'),x=-x;
        _print(x);
        if(c) putchar(c);
    }
}
namespace BIT_{
    template<typename T> struct BIT{
        int Size;
        vector<T> Num;
        BIT<T>(){Size=0;}
        BIT<T>(int S){Num.resize((Size=S)+5,0);}
        void Update(T x,int pos){
            for(int i=pos;i<=Size;i+=lowbit(i))
                Num[i]+=x;
        }
        T GetSum(int pos){
            T ret=0;
            for(int i=pos;i>0;i-=lowbit(i))
                ret+=Num[i];
            return ret;
        }
    };
}
namespace Math_{
    int Pow(LL x,LL y,int MOD){
        int ret=1;
        while(y){
            if(y&1)
                ret=ret*x%MOD;
            y>>=1;
            x=x*x%MOD;
        }
        return ret;
    }
    void GetPrime(int N,vector<int> &Prime){
        vector<int> vis;
        vis.resize(N+5,0);
        for(int i=2;i<=N;i++){
            if(!vis[i])
                Prime.push_back(i);
            for(int j=0;j<int(Prime.size())&&Prime[j]*i<=N;j++){
                vis[Prime[j]*i]=1;
                if(i%Prime[j]==0)
                    break;
            }
        }
    }
    template<typename T> void Divide(T N,vector<PII> &A,vector<int> Prime){
        for(int i=0;i<int(Prime.size());i++){
            int p=Prime[i],cnt=0;
            while(N%p==0)
                N/=p,cnt++;
            if(cnt)
                A.push_back(make_pair(p,cnt));
            if(N==1||Prime[i]*Prime[i]>N)
                break;
        }
        if(N>1)
            A.push_back(make_pair(N,1));
    }
    void GetFac(int N,int MOD,int *fac){
        fac[0]=1;
        for(int i=1;i<=N;i++)
            fac[i]=(LL)fac[i-1]*i%MOD;
    }
    void GetFac(int N,int MOD,int *fac,int *facInv){
        GetFac(N,MOD,fac);
        facInv[N]=Pow(fac[N],MOD-2,MOD);
        for(int i=N-1;i>=0;i--)
            facInv[i]=(LL)facInv[i+1]*(i+1)%MOD;
    }
    void GetC(int N,int **C,int MOD){
        C[0][0]=1;
        for(int i=1;i<=N;i++)
            for(int j=1;j<=i;j++)
                C[i][j]=((LL)C[i-1][j-1]+(LL)C[i-1][j])%MOD;
    }
    int calC(int N,int M,int MOD,int *fac,int *facInv){
        if(M>N) return 0;
        return (LL)fac[N]*facInv[N-M]%MOD*facInv[M]%MOD;
    }
    int calC(int N,int M,int MOD){
        if(M>N) return 0;
        if(M>N-M) M=N-M;
        int ret=1,cnt=1;
        for(int i=N;i>=N-M+1;i--)
            ret=(LL)ret*i/cnt%MOD,cnt++;
        return ret;
    }
    int calA(int N,int M,int MOD,int *fac,int *facInv){
        if(M>N) return 0;
        return (LL)fac[N]*facInv[N-M+1]%MOD;
    }
    int calA(int N,int M,int MOD){
        if(M>N) return 0;
        int ret=1;
        for(int i=N;i>=N-M+1;i--)
            ret=(LL)ret*i%MOD;
        return ret;
    }
}
namespace DSU_{
    struct DSU{
        vector<int> fa;
        DSU(){}
        DSU(int Size){
            fa.resize(Size+5,0);
            for(int i=1;i<=Size;i++)
                fa[i]=i;
        }
        int Find(int x){return fa[x]==x?x:fa[x]=Find(fa[x]);}
        bool Same(int x,int y){return Find(x)==Find(y);}
        void Unite(int x,int y){fa[Find(x)]=Find(y);}
        int Count(int N){
            int ret=0;
            for(int i=1;i<=N;i++)
                if(Find(i)==i)
                    ret++;
            return ret;
        }
    };
}

using namespace FastIO_;
#define MAXN 100000
int N,M;
struct node{
    int u,v,id,dir;
}Edge[MAXN+5];
vector<node> G[MAXN+5];
vector<PII> ans;

int out[MAXN+5];
int dep[MAXN+5];
int faID[MAXN+5];
bool dfs(int u,int fa,int d){
    out[u]=0;
    dep[u]=d;
    for(int i=0;i<int(G[u].size());i++){
        int v=G[u][i].v,k=G[u][i].id;
        if(v!=fa&&dep[v]<dep[u]){
            Edge[k].dir=Edge[k].u==u;
            faID[v]=k;
            if(out[v]==-1){
                if(!dfs(v,u,d+1))
                    out[u]++,ans.push_back(make_pair(u,v));
                else
                    out[v]++,ans.push_back(make_pair(v,u));
            }
            else
                out[u]++,ans.push_back(make_pair(u,v));
        }
    }
    if(out[u]%2){
        int f=faID[u];
        Edge[f].dir=!Edge[f].dir;
        return 1;
    }
    return 0;
}

int main(){
    N=read<int>(),M=read<int>();
    int cnt=0;
    for(int i=1;i<=M;i++){
        int u=read<int>(),v=read<int>();
        G[u].push_back((node){u,v,i,0});
        G[v].push_back((node){v,u,i,0});
        Edge[i]=(node){u,v,i,0};
    }
    memset(out,-1,sizeof out);
    dfs(1,-1,1);
    if(out[1]%2)
        return puts("-1"),0;
        /*
    for(int i=1;i<=M;i++){
        if(Edge[i].dir==1)
            print<int>(Edge[i].u,' '),print<int>(Edge[i].v,'\n');
        else
            print<int>(Edge[i].v,' '),print<int>(Edge[i].u,'\n');
    }
    */
    for(int i=0;i<ans.size();i++) printf("%d %d\n",ans[i].first,ans[i].second);
}


Measured memory_bytes: 23028