import algorithm, sequtils, strutils let n = parseInt readLine stdin xs = n.newSeqWith stdin.readLine.split.map parseInt sorted = xs.sortedByIt -it[0] / it[1] for x in sorted: echo x[0], " ", x[1]