import typing import sys from collections import defaultdict input = lambda: sys.stdin.readline().strip() inf = 10**18 mod = 998244353 # import pypyjit # pypyjit.set_param('max_unroll_recursion=-1') # sys.setrecursionlimit(10**6) def solve(): N, M, W = map(int, input().split()) A = list(map(int, input().split())) A.sort(reverse=True) acc = [0] for a in A: acc.append(a+acc[-1]) B = list(map(int, input().split())) C = list(map(int, input().split())) ans = 0 for s in range(1<> i)&1: v += C[i] w += B[i] if w > W: continue v += acc[min(N, W-w)] ans = max(ans, v) print(ans) def main(): t = 1 for _ in range(t): solve() main()