N=int(input()) S=[list(map(int,input().split())) for i in range(N)] M=1<