n, m = gets.chomp.split(" ").map(&:to_i)
graphs = []
graph_counts = Array.new(10 ** 5, 0)
n.times do
  tmp_1, tmp_2 = gets.chomp.split(" ").map(&:to_i)
  graph_counts[tmp_1 - 1] += 1
  graphs << [tmp_1, tmp_2]
end

3.times do
  graphs.each_with_index do |graph, index|
    if graph_counts[graph[0] - 1].odd? && graph_counts[graph[1] - 1].odd?
      graph_counts[graph[0] - 1] -= 1
      graph_counts[graph[1] - 1] += 1
      tmp = graph[0]
      graphs[index][0] = graph[1]
      graphs[index][1] = tmp
    end
  end
end

graph_counts.each do |graphs_count|
  if graphs_count.odd?
    puts "-1"
    exit
  end
end

graphs.each do |graph|
  puts "#{graph[0]} #{graph[1]}"
end