#include <thread>
#ifdef __GNUC__
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define unordered_map __fast_unordered_map
template<class Key, class Value, class Hash = std::hash<Key>>
using unordered_map = __gnu_pbds::gp_hash_table<Key, Value, Hash>;
#else
#include <iostream>
#include <fstream>
#include <vector>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include <array>
#include <cstdlib>
#include <stack>
#include <string>
#include <queue>
#include <chrono>
#include <functional>
#include <limits>
#include <cmath>
#include <algorithm>
#include <random>
#include <regex>
#include <tuple>
#include <numeric>
#include <cassert>
#include <utility>
#include <bitset>
#include <complex>
#include <iomanip>
#include <ostream>
#include <sstream>
#include <ctime>
unsigned int __builtin_popcount(unsigned int x)
{
	int ret = 0;
	while(x)
	{
		ret += x & 1;
		x >>= 1;
	}
	return ret;
}
unsigned long long __builtin_popcountll(unsigned long long x)
{
	int ret = 0;
	while(x)
	{
		ret += x & 1LL;
		x >>= 1LL;
	}
	return ret;
}
long long __gcd(long long a, long long b)
{
	assert(a >= 0);
	assert(b >= 0);
	if (b == 0) return a;
	long long ret = __gcd(b, a % b);
	assert(ret);
	return ret;
}
int __gcd(int a, int b)
{
	assert(a >= 0);
	assert(b >= 0);
	if (b == 0) return a;
	int ret = __gcd(b, a % b);
	assert(ret);
	return ret;
}
#endif
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef unsigned short ushort;
const ll INFLL = 2 * (ll)1e18 + 100;
#define for0(i, n) for(int i = 0; i < n; ++i)
#define for1(i, n) for(int i = 1; i <= n; ++i)
#define pb push_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define V vector<int>
#define VP vector<pair<int, int> >
#define FASTIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define index INDEX
template<class T> ostream &operator<<(ostream& os, const vector<T>& v) {
	if (v.empty()) return os;
	for (std::size_t i = 0; i < v.size() - 1; ++i) os << v[i] << ' ';
	return os << v.back();
}
template<class T> ostream &operator<<(ostream& os, const deque<T>& v) {
	if (v.empty()) return os;
	for (std::size_t i = 0; i < v.size() - 1; ++i) os << v[i] << ' ';
	return os << v.back();
}
template<class T> ostream &operator<<(ostream& os, const set<T>& v) {
	if (v.empty()) return os;
	auto aux = v.end(); --aux;
	for(auto it = v.begin(); it != aux; ++it)
	{
		os << *it << ' ';
	}
	return os << *aux;
}
template<class T> ostream &operator<<(ostream& os, const multiset<T>& v) {
	if (v.empty()) return os;
	auto aux = v.end(); --aux;
	for(auto it = v.begin(); it != aux; ++it)
	{
		os << *it << ' ';
	}
	return os << *aux;
}
template<class L, class R> ostream &operator<<(ostream &os, const pair<L,R>& P) {
	return os << P.first << " " << P.second;
}
template<class TH> void _dbg(const char *sdbg, TH h){ cerr << sdbg << " = " << h << '\n'; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',') cerr << *sdbg++;
  cerr<<" = "<< h << ','; _dbg(sdbg + 1, a...);
}
#ifdef AJECC 
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif
auto rng_obfuscated$19937 = mt19937_64(chrono::steady_clock::now().time_since_epoch().count());
ll generate_random() {
	const ll MAX_RANDOM = (ll)1e12 + 1;
	return uniform_int_distribution<unsigned long long>(1LL, MAX_RANDOM)(rng_obfuscated$19937);
}
#define int ll /// might modify this sometimes
#ifdef int 
const int INFINT = INFLL;
#else
const int INFINT = 2 * (int)1e9 + 100;
#endif
const double PI = atan(1) * 4;
const double EPS = 1e-6; const int SEED = (int)1e3 + 7;
const int MOD = (int)1e9 + 7;
const int NMAX = (int)1e5 + 5;

#define even 0
#define odd 1
#define from 0
#define to 1

int n, m;
bool color[NMAX];
V graf[NMAX];
set<int> bipart[NMAX];
set<int> odd_part;

map<pair<int, int>, bool> dir;

bool match()
{
	if (odd_part.size() < 2) return false;
	int start = *odd_part.begin();

	int middle = -1;
	for(auto &i : bipart[start])
	{
		if (bipart[i].size() >= 2)
		{
			middle = i;
			break;
		}
	}
	if (middle == -1) return false;

	auto it = bipart[middle].begin();
	if (*it == start) ++it;
	if (it == bipart[middle].end()) return false;

	int finish = *it;
	dir[mp(min(start, middle), max(start, middle))] ^= 1;
	dir[mp(min(finish, middle), max(finish, middle))] ^= 1;
	color[start] = color[finish] = even;
	odd_part.erase(start);
	odd_part.erase(finish);
	for(auto &i: graf[start])
	{
		if(color[i] == even)
		{
			bipart[i].erase(start);
			bipart[start].erase(i);
		}
		else
		{
			bipart[i].insert(start);
			bipart[start].insert(i);
		}
	}
	for(auto &i: graf[finish])
	{
		if(color[i] == even)
		{
			bipart[i].erase(finish);
			bipart[finish].erase(i);
		}
		else
		{
			bipart[i].insert(finish);
			bipart[finish].insert(i);
		}
	}
	return true;
}

void build_bipart()
{
	for1(i, n)
	{
		if (color[i] == even) continue;
		for(auto& j : graf[i]) if(color[j] == odd)
		{
			color[i] = even;
			color[j] = even;
			dir[mp(min(i, j), max(i, j))] ^= 1;
			break;
		}
	}
	for1(i, n)
	{
		if (color[i] == even) continue;
		for(auto& j: graf[i]) if(color[j] == even)
		{
			bipart[i].insert(j);
			bipart[j].insert(i);
		}
		odd_part.insert(i);
	}
}

bool trecut[NMAX];
int last_odd = -1;
V in_stack;
void dfs(int nod)
{
	trecut[nod] = 1;
	in_stack.pb(nod);
	if(color[nod] == odd)
	{
		if (last_odd == -1) last_odd = nod;
		else
		{
			color[nod] = even;
			color[last_odd] = even;
			for(int i = in_stack.size() - 1; i >= 0; i--)
			{
				int l = in_stack[i], r = in_stack[i - 1];
				dir[mp(min(l, r), max(l, r))] ^= 1;
				if (last_odd == r) break;
			}
			last_odd = -1;
			return;
		}
	}
	for(auto& i: graf[nod]) if(!trecut[i])
	{
		dfs(i);
	}
	if(color[in_stack.back()] == odd)
	{
		cout << -1;
			exit(0);
	}
	in_stack.pop_back();
}

int32_t main() {
	FASTIO; /// disable for interactive
#ifdef AJECC 
	double START_PROGRAM = clock();
#endif
#ifndef AJECC
//#define PROB_NAME "pm2"
//	freopen(PROB_NAME".in", "r", stdin);
//	freopen(PROB_NAME".out", "w", stdout);
#endif
	cin >> n >> m;
//	if (m % 2 == 1) return cout << -1, 0;
	for1(i, m)
	{
		int a, b;
		cin >> a >> b;
		if (a > b) swap(a, b);
		dir[mp(a, b)] = from;
		color[a] ^= 1;
		graf[a].pb(b);
		graf[b].pb(a);
	}
	build_bipart();
	while (match());
	for1(i, n) if(!trecut[i])
		dfs(i);
	for1(i, n) if (color[i] == odd)
	{
		for (auto& j : graf[i]) assert(color[j] == even);
		return cout << -1, 0;
	}
	for(auto& i : dir)
	{
		if (i.second == from) cout << i.first.first << ' ' << i.first.second << '\n';
		else cout << i.first.second << ' ' << i.first.first << '\n';
	}




#ifdef AJECC 
	double END_PROGRAM = clock();
	double ELAPSED_TIME = (END_PROGRAM - START_PROGRAM) / CLOCKS_PER_SEC;
	cerr << "\n\nElapsed Time: " << ELAPSED_TIME * 1000 << "\n";
#endif
	return 0;
}

