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 = acc_A[min(W, N)] for i in range(1, M+1): for comb in combinations(zip(B, C), r=i): sum_weight = sum([b for b, _ in comb]) sum_value = sum([c for _, c in comb]) if sum_weight > W: continue value = sum_value + acc_A[min(W - sum_weight, N)] ans = max(ans, value) print(ans)