from itertools import accumulate 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())) acc = list(accumulate(sorted(A, reverse=True))) ans = 0 for i in range(1 << M): w = v = 0 for j in range(M): if ~i & (1 << j): continue w += B[j] v += C[j] if w > W: break if w <= W: cnt = W-w if cnt > 0: v += acc[min(cnt-1, len(acc)-1)] ans = max(ans, v) print(ans)