rest = Array.new
3.times do
  ps = Array.new
  8.times do
    num,t =  gets.split
    num = num.to_i
    t = t.to_f
    ps << [num,t]
  end
  ps.sort!{|a,b| a[1]-b[1]}
  puts "%d %.2f" % ps[0]
  puts "%d %.2f" % ps[1]
  rest << ps[2]
end
rest.sort!{|a,b| a[1]-b[1]}
puts "%d %.2f" % rest[0]
puts "%d %.2f" % rest[1]