one = {}
two = {}
three = {}

8.times do
  s,t = gets.split.map(&:to_f)
one[s.to_i] = t
end

8.times do
  s,t = gets.split.map(&:to_f)
  two[s.to_i] = t
end

8.times do
  s,t = gets.split.map(&:to_f)
  three[s.to_i] = t
end
top_rank = []

one_ary = one.sort {|(k1,v1),(k2,v2)| v1 <=> v2}
two_ary =two.sort {|(k1,v1),(k2,v2)| v1 <=> v2}
three_ary = three.sort{|(k1,v1),(k2,v2)| v1 <=> v2}
 top_rank.push(one_ary[0],one_ary[1],two_ary[0],two_ary[1],three_ary[0],three_ary[1])

one_ary.slice!(0,2)
two_ary.slice!(0,2)
three_ary.slice!(0,2)
under_rank = one_ary.concat(two_ary,three_ary).sort{|a,b| a[1]<=>b[1]}

top_rank.each do |i|
  i[1] = sprintf("%.02f",i[1])
  puts i.join(" ")
  end
  under_rank.each_with_index do |v,i|
    v[1] = sprintf("%.02f",v[1])
    if i < 2
      puts v.join(" ")
    end
  end
