import itertools # M<=20よりMについて全探索 N, M, W = map(int, input().split()) A = sorted(list(map(int, input().split())))[::-1] As = list(itertools.accumulate(A)) B = list(map(int, input().split())) C = list(map(int, input().split())) cnt = [] for i in range(2**M): ws = 0 ps = 0 flag = True for j in range(M): if ((i >> j) & 1): ws += B[j] ps += C[j] if ws > W: flag = False break if flag: if ws == W: cnt.append(ps) else: remaining_weight = W - ws if remaining_weight - 1 < len(A): cnt.append(ps + As[remaining_weight - 1]) else: cnt.append(ps + As[-1]) print(max(cnt)) "🐬"