N, M = gets.split.map(&:to_i)
lines = []
M.times do
  lines << gets.split.map(&:to_i)
end

if lines.size % 2 != 0
  puts -1
end

lines.each do |line|
  lines.each do |line2|
    if line[0] == line2[1]
      line2[1] = line2[0] ^ line2[1]
      line2[0] = line2[1] ^ line2[0]
      line2[1] = line2[0] ^ line2[1]
      break
    end
  end
end

puts lines.map{|line| line.join(' ')}.join("\n")
