import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines from functools import reduce N,M,K = map(int,readline().split()) As = [list(map(int,readline().split())) for _ in range(N)] dp = 1 for A in As: dp = reduce(lambda x,y: x|(dp << y), A, 0) dp = dp & ((1<