#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<bitset>
#include<fstream>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
#include<fstream>
const ll INF=9223372036854775807;
const ll mod=1000000007;
int  MOD(int  a, int  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b, ll  c)
{
    return max(c,max(a,b));
}
ll min3(ll  a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y,ll mod1)
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod1;
        y = y>>1;
        x = (x*x)%mod1;
    }
    return res;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x,ll p)
{
    return power(x,p-2,p);
}
void upd(int ind,vi &bit,int val)
{
    for(int j=ind;j<bit.size();j+=(j)&(-j))
    {
        bit[j]+=val;
    }
}
int query(int ind,vi &bit)
{
    int ret=0;
    for(int j=ind;j>0;j-=(j)&(-j))
    {
        ret+=bit[j];
    }
    return ret;
}
int n,m;
vvi adj;
vvi tree;
set<pair<int,int>> g;
vi vis;
vi par;
vi deg;
vi sum;
void dfs(int i)
{
    vis[i]=1;
    for(int j=0;j<adj[i].size();j++)
    {
        if(!vis[adj[i][j]])
        {
            par[adj[i][j]]=i;
            tree[adj[i][j]].push_back(i);
            tree[i].push_back(adj[i][j]);
            dfs(adj[i][j]);
        }
    }
}
void solve(int i)
{
    vis[i]=1;
    sum[i]=deg[i];
    for(int j=0;j<adj[i].size();j++)
    {
        if(par[i]!=adj[i][j])
        {
            solve(adj[i][j]);
            sum[i]+=sum[adj[i][j]];
            if(sum[adj[i][j]]%2==1)
            {
                if(g.find(mp(i,adj[i][j]))!=g.end())
                {
                    g.erase(mp(i,adj[i][j]));
                    g.insert(mp(adj[i][j],i));
                }
                else
                {
                    g.erase(mp(adj[i][j],i));
                    g.insert(mp(i,adj[i][j]));
                }
            }
        }
    }
}

int main()
{
  
  	fastio;
    cin>>n>>m;
    adj.resize(n+1);
    vis.resize(n+1);
    par.resize(n+1);
    deg.resize(n+1);
    sum.resize(n+1);
    tree.resize(n+1);
    par[1]=-1;
    for(int i=0;i<m;i++)
    {
        int u,v;
        cin>>u>>v;
        adj[u].pb(v);
        adj[v].pb(u);
        deg[u]++;
        g.insert(mp(u,v));
    }
    int s=0;
    for(int i=1;i<=n;i++)
    {
        s+=deg[i];
        deg[i]=deg[i]%2;
    }
    if(s%2==1)
    {
        cout<<-1;
        return 0;
    }
    else
    {
        dfs(1);
        for(int i=0;i<=n;i++)
        {
            vis[i]=0;
        }
        adj=tree;
        solve(1);
        while(!g.empty())
        {
            cout<<(*g.begin()).f<<' '<<(*g.begin()).s<<endl;
            g.erase(g.begin());
        }
    }
}


Measured memory_bytes: 24832