from collections import Counter N=int(input()) S=[list(map(int,input().split())) for i in range(N)] ANS=[0]*N def listbit(x): for i in range(1<