n=gets.to_i $<.read.split(/\n/).sort_by{|i|a,b=i.split.map(&:to_f);a/b}.reverse.each{|i|puts i}