from itertools import combinations, accumulate N, M, W = map(int, input().split()) A = sorted(map(int, input().split()), reverse=True) B = list(map(int, input().split())) C = list(map(int, input().split())) acc_A = [0] + list(accumulate(A)) ans = 0 for i in range(M): for comb in combinations(zip(B, C), r=i): if (sum_cost := sum([c for _, c in comb] + [0])) > W: continue value = sum([b for b, _ in comb] + [0]) + acc_A[min(W - sum_cost, M)] ans = max(ans, value) print(ans)