def sgn(s,k): return 1 if (s>>k)&1 else -1 def solve(): N=int(input()) A=[0]*N; B=[0]*N; C=[0]*N; D=[0]*N; E=[0]*N for i in range(N): A[i],B[i],C[i],D[i],E[i]=map(int,input().split()) K=5 inf=float("inf") T=[inf]*(1<