n,m,k = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(n)] mask = (1<