rs = []
bs = []
24.times.map { p, t = gets.split; [t.to_f, p.to_i] }.each_slice(8).map(&:sort).each {|as| rs += as[0...2]; bs += as[2..-1] }
bs.sort!
rs += bs[0...2]
rs.each {|t, p| puts '%d %.2f' % [p, t] }