N = int(input()) A = [] for i in range(N): row = list(map(int, input().split())) A.append(row) AN = [0] * N for bit in range(1<<4): F=[0]*N M=-1000000000000000000 m=1000000000000000000 for i in range(N): for j in range(5): if(bit&(1<