실버5 문제
n = int(input()) arr = [] for i in range(n): a, b = map(int, input().split()) arr.append([a, b]) arr.sort(key = lambda x:(x[1], x[0])) for j in arr: print(*j)