n = int(input()) d = [list(map(int,input().split())) for _ in range(n)] N = 1<