n = int(input()) d = [list(map(int,input().split())) for _ in range(n)] N = 1<>w&1: continue nmask = mask | ((1<