
final = Hash.new

3.times do
        race = Hash.new
        8.times do
                run = get.split(" ")
                race << run
        end
        race.sort!{|t1,t2| t1[1]-t2[1]}
        puts "%d %.2f" % race[0]
        puts "%d %.2f" % race[1]
        final << race[2]
end
final.sort!{|t1,t2| t1[1]-t2[1]}
puts "%d %.2f" % final[0]
puts "%d %.2f" % final[1]