local mfl, mce = math.floor, math.ceil
local n, m = io.read("*n", "*n")
local edge = {}
local edgenum = {}
for i = 1, n do
  edge[i] = {}
end
for i = 1, m do
  local a, b = io.read("*n", "*n")
  edge[a][b], edge[b][a] = true, true
end
if m % 2 == 1 then
  print(-1)
  os.exit()
end
for i = 1, n do
  local dsts = {}
  for dst, _u in pairs(edge[i]) do
    table.insert(dsts, dst)
  end
  local lim = mfl(#dsts / 2)
  for j = 1, lim, 2 do
    print(i .. " " .. dsts[j * 2 - 1])
    print(i .. " " .. dsts[j * 2])
  end
  for j = 1, lim * 2 do
    edge[dsts[j]][i] = nil
    edge[i][dsts[j]] = nil
  end
end
local remedge = {}
for i = 1, n do
  for d, _u in pairs(edge[i]) do
    table.insert(remedge, {i, d})
  end
end
assert(#remedge == 0)
