N, M, W = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) D = list(map(int, input().split())) Weight = A + [-c for c in C] Value = B + [-d for d in D] nm = N + M dp = [-(10**9)] * 2**nm dp[0] = 0 ans = 0 for i in range(2**nm): if dp[i] == -(10**9): continue w = 0 for j in range(nm): if i >> j & 1: w += Weight[j] for j in range(nm): if i >> j & 1: continue if 0 <= w+Weight[j] <= W: dp[i|1<