n = int(input()) counton = [0]*n for i in range(n): b = input().split() for j in range(n): counton[i] += 1<>j)&1) == 1 else 0 # 高速化出来る # if tmp >= ans: # continue lie, confess, k = i, 0, -1 while k+1 < n: k += 1 if ((confess>>k)&1) == 1: continue if (lie&counton[k]) == counton[k]: confess |= 1<