l=[] for _ in[0]*int(input()):x,y=map(int,input().split());l.append([x/y,[x,y]]) for t in sorted(l)[::-1]:print(*t[1])