b=[(x, y) for i in range(int(input()))] for x, y in sorted(b): print(x, y)