import sys read=sys.stdin.buffer.read readline=sys.stdin.buffer.readline readlines=sys.stdin.buffer.readlines def solve1(a, c): mn=10**9 for i, x in enumerate(a): mx=0 for y in a[i+1:]: if xx: if c[x][y]y: z=max(x, mx) if c[x][y]