#define LOCAL
#include "bits/stdc++.h"
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(0);
#define LLINF ((long long) 1e18)//1234567890987654321
#define INF 1234567890ll
#define pb push_back
#define eb emplace_back
#define ins insert
#define f first
#define s second	
#define db 0
#define EPS (1e-7)    //0.0000001 the value
#define PI (acos((ld)-1.0))
#define MAXN (300006)
#define ll long long int 
#define ld long double
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
#define FOR(ii, ss, ee) for(ll ii = ss; ii < (ll)ee; ++ii)
#define space " "
#define cbr cerr << "hi\n"
#define mmst(x, v) memset((x), v, sizeof ((x)))
#define siz(x) ((ll)x.size())
#define ph push
#define btinpct(x) __builtin_popcountll((x))
#define MSB(bm) (63-__builtin_clzll((bm)))
#define all(x) (x).begin(), (x).end()
#define lbd(x, y) lower_bound(all(x), y)
#define ubd(x, y) upper_bound(all(x), y)
typedef pair <ll, ll> pi;
typedef pair <ll, pi> spi;
typedef pair <pi, pi> dpi;
inline ll rand(ll x, ll y) { ++y; return (rng() % (y-x)) + x; } //inclusivesss
string to_string(char c) {string s(1,c);return s;}string to_string(bool b){return (b ? "true" : "false");}template <typename A, typename B>string to_string(pair<A, B> p) {return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}template <typename A>string to_string(A v) {bool first = true;string res = "{";for (const auto &x : v) {if (!first) {res += ", ";}first = false;res += to_string(x);}res += "}";return res;}void degug_out() { cerr << endl; }template <typename Head, typename... Tail>void degug_out(Head H, Tail... T) {cerr << " " << to_string(H);degug_out(T...);}inline ll gcd(ll a,ll b){if(a>b)swap(a,b);if(a==0)return b;return gcd(b%a,a);}
#ifdef LOCAL
// #define degug(...) cerr << "[" << #__VA_ARGS__ << "]:", degug_out(__VA_ARGS__)
#else
#define degug(...) 42
#define cerr if(0)cout
#endif
ll n,m;
int deg[MAXN]; int ans[MAXN]; 
bitset<MAXN>vis; vector<pi>v[MAXN];
bitset<MAXN>taken; int sides[MAXN];
void dfs(ll x,ll p=-1) {
	if(vis[x])return;
	vis[x]=1;
	for(auto i:v[x]) dfs(i.f,x);
	
	{
		bool got=0; pi who;
		for(auto i:v[x])if(!taken[i.s]&&i.f!=p){
			if(ans[i.f]&1) { ans[i.f]++, taken[i.s]=1; deg[x]--,deg[i.f]--; got=1; who=i; sides[i.s]=i.f; }
			else { ans[x]++; taken[i.s]=1; deg[x]--,deg[i.f]--; got=1; who=i; sides[i.s]=x; }
		}
	}
}
pi edges[MAXN];
bool check() {
	FOR(i,1,n+1) if(ans[i]&1) return 0;
	FOR(i,0,m){
		if(!taken[i]) return 0;
	}
	return 1;
}
void answer() {
	FOR(i,0,m){
		if(sides[i]==edges[i].f) cout<<edges[i].f<<' '<<edges[i].s<<'\n';
		else if(sides[i]==edges[i].s) cout<<edges[i].s<<' '<<edges[i].f<<'\n';
	}
	exit(0);
}
int main()
{
	FAST
	cin>>n>>m;
	ll a,b;
	FOR(i,0,m){
		cin>>a>>b;
		v[a].pb(pi(b,i));v[b].pb(pi(a,i));
		deg[a]++,deg[b]++; edges[i]=pi(a,b);
	}
	ll odeg[n+1]; FOR(i,0,n+1) odeg[i]=deg[i];
	ans[a]++;deg[a]--,deg[b]--;
	vis=0; taken=0; taken[m-1]=1; sides[m-1]=a; 
	dfs(a);
	if(check()) {
		answer();
	}
	mmst(ans,0);
	FOR(i,0,n+1)deg[i]=odeg[i];
	ans[b]++,deg[a]--,deg[b]--;
	vis=0;
	taken=0; mmst(sides,0);
	taken[m-1]=1;
	sides[m-1]=b;
	dfs(b);
	if(check()){
		answer();
	}
	cout<<"-1\n";
}


Measured memory_bytes: 25216