let N = Int(readLine()!) var dict = [Double:String]() for _ in 0...N! - 1{ let S = readLine()! let s = S.split(separator: " ").map{Double($0)!} dict[Double(s[0] / s[1])] = S } for i in dict.sorted(by: >){ print(i.value) }