result = []
ut = []
3.times do
  time = []
  8.times { time << gets.split.map(&:to_f) }
  time.sort_by!{ |t| t.last }
  result << time[0,2]
  ut << time[2,2]
end
result << ut.flatten(1).sort_by{ |t| t.last }[0,2]
result.flatten(1).each{ |t| puts "%d %.2f" % t }