//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

#include <stdexcept>

using namespace std;

// type alias
using ll = long long;
using ull = unsigned long long;

//conversion
//------------------------------------------
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class t> inline string tostring(t x) { ostringstream sout; sout << x; return sout.str(); }

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl
#define DEBUG(x) cerr << #x << " = " << (x) << " (l" << __line__ << ")" << " " << __file__ << endl

inline ll floor(ll a, ull b)
{
	ll llb = b;
	if (a >= 0)
	{
		return a / llb;
	}
	else
	{
		return - ( (-a + llb - 1) / llb);
	}
}

inline ll ceil(ll a, ull b)
{
	ll llb = b;
	if (a >= 0)
	{
		return (a + llb - 1) / llb;
	}
	else
	{
		return - (-a / llb);
	}
}

inline ll getLowestOneBit(ll a)
{
	return a & (-a);
}

inline ll getHighestOneBit(ll a)
{
	while ((a & (a - 1)) != 0)
	{
		a = a & (a - 1);
	}
	return a;
}

inline bool isPower2(ull a)
{
	if (a == 0)
	{
		return false;
	}
	return !(a & (a - 1));
}

inline ll getSpecifiedBit(ll a, unsigned bit)
{
	return (a & (1LL << bit)) >> bit;
}

// computational complexity: o(log(max(a, b))) 
inline ull getGcd(ull a, ull b)
{
	if (b == 0)
	{
		return a;
	}
	return getGcd(b, a % b);
}

template<class Integer>
inline Integer getPower(Integer base, ull exponential)
{
	Integer result = 1;
	while (exponential >= 1)
	{
		if (exponential & 1)
		{
			result = result * base;
		}
		base = base * base;
		exponential >>= 1;
	}

	return result;
}

ll dfs(ll currNode, const vector<set<ll>>& edges, vector<ll>& lengths, vector<bool>& haveChecked)
{
	if (lengths[currNode] != -1)
	{
		return lengths[currNode];
	}

	haveChecked[currNode] = true;
	ll length = 0;
	for (auto& node : edges[currNode])
	{
		if (haveChecked[node])
		{
			continue;
		}
		length = max(length, dfs(node, edges, lengths, haveChecked) + 1);
	}
	lengths[currNode] = length;

	return length;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll N, M;
	cin >> N >> M;

	if (M % 2 != 0)
	{
		cout << -1 << endl;
		return 0;
	}

	vector<set<ll>> edges(N);
	ll a, b;
	for (ll i = 0; i < M; ++i)
	{
		cin >> a >> b;
		--a, --b;
		edges[a].insert(b);
		edges[b].insert(a);
	}

	vector<ll> lengths(N, -1);
	vector<bool> haveChecked(N, false);
	dfs(0, edges, lengths, haveChecked);

	vector<ll> indices(N);
	vector<ll> arrows(N, 0);
	for (ll i = 0; i < N; ++i)
	{
		indices[i] = i;
	}

	sort(indices.begin(), indices.end(), [&lengths](const size_t a, const size_t b)
	{
		return lengths[a] < lengths[b];
	});

	for (const auto& index : indices)
	{
		for (auto iter = edges[index].begin(); iter != edges[index].end(); ++iter)
		{
			if (arrows[index] % 2 != 0)
			{
				++arrows[index];
				cout << (index + 1) << " " << (*iter + 1) << endl;
			}
			else
			{
				++arrows[*iter];
				cout << (*iter + 1) << " " << (index + 1) << endl;
			}
			edges[*iter].erase(index);
		}
	}
	
	

	return 0;
}


Measured memory_bytes: 25600