#include <bits/stdc++.h>

// #define DEBUG 1

#define int long long
#define for0(i,n) for (int i=0; i<n; i++)
#define fill1(a,z) fill_n(a, sizeof(a)/sizeof(a[0]), z)
#define fill2(a,z) fill_n(a[0], sizeof(a)/sizeof(a[0][0]), z)
#define fill3(a,z) fill_n(a[0][0], sizeof(a)/sizeof(a[0][0][0]), z)
#define mp make_pair
#define X first
#define Y second
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define all(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define pmod(x,m) (((x)%(m)+m)%m)
#ifdef int
#define read(x) scanf("%lld",&x);
#else
#define read(x) scanf("%d",&x);
#endif

#ifdef DEBUG
#define nl cout<<"\n";
#define pr(x) cout<<(x)<<" ";
#define prl(x) cout<<#x " = "<<x<<endl;
#define prp(x) cout<<"("<<(x).first<<" "<<(x).second<<") ";
#define printv(v) {for(int _=0; _<sz(v); _++) cout<<v[_]<<" "; cout<<"\n";}
#define printa(a,s) {for (int _=0; _<s; _++) cout<<a[_]<<" "; cout<<"\n";}
#define print2D(a,m,n) {for (int _=0; _<m; _++) {for (int __=0; __<n; __++) cout<<a[_][__]<<" "; cout<<"\n";} cout<<"\n";}
#define priter(v) {for (auto x : v) {pr(x)} nl}
#define debug cout<<"ok at line "<<__LINE__<<endl;
#else
#define nl
#define pr(x)
#define prl(x)
#define prp(x)
#define printv(v)
#define printa(a,s)
#define print2D(a,m,n)
#define priter(v)
#define debug
#endif
#define MAXN 100000

using namespace std;

typedef long long ll;

const int INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;

int parity[MAXN+5]; 
bool visited[MAXN+5]; 
vector<int> adj[MAXN+5]; 

vector<pair<int,int>> tree_edges; 
set<pair<int,int>> tree_edge_set; 
vector<int> node_order; 

void dfs(int root)
{
    for (int u : adj[root]) {
        if (not visited[u]) {
            visited[u] = true;
            dfs(u); 
            tree_edge_set.insert({root,u}); 
            tree_edges.push_back({root,u}); 
        }
    }
}

int32_t main()
{
    #ifdef DEBUG
    //freopen("B.txt","r",stdin);
    //freopen("","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n,m;
    cin >> n >> m; 
    fill1(parity,0); 
    fill1(visited,false); 
    vector<pair<int,int>> edges, ans; 
    
    for0(i,m) {
        int a,b;
        cin >> a >> b; 
        adj[a].push_back(b); 
        adj[b].push_back(a); 
        edges.push_back({a,b}); 
    }
    
    visited[1] = true;
    dfs(1); 
    
    for (auto e : edges) {
        if (tree_edge_set.find(e) == tree_edge_set.end() and tree_edge_set.find({e.second,e.first}) == tree_edge_set.end()) {
            pr("non-tree edge") prp(e) nl 
            ans.push_back(e); 
            parity[e.first] ^= 1; 
        }
    }
    
    for (auto e : tree_edges) {
        // e.first is parent 
        pr("tree edge") prp(e) nl 
        if (parity[e.second]) {
            ans.push_back({e.second,e.first}); 
            parity[e.second] ^= 1;
        }
        else {
            ans.push_back(e); 
            parity[e.first] ^= 1; 
        }
    }
    
    bool ok = true; 
    for (int i=1; i<=n; i++) {
        if (parity[i]) {
            ok = false; 
            break; 
        }
    }
    
    if (ok) {
        assert(sz(edges) == m); 
        for (pair<int,int> e : ans) {
            cout << e.first << " " << e.second << endl; 
        }
    }
    else 
        cout << -1 << endl; 
    return 0;
}


Measured memory_bytes: 26864