from functools import lru_cache N=int(input()) S=[list(map(int,input().split())) for i in range(N)] bit_set=[[] for n in range(N+1)] for N in range(N+1): for bit in range(1<