import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
#input = sys.stdin.readline
#n = int(input())
#
#alist = []
#s = input()
n,m,w = map(int,input().split())
alist = list(map(int,input().split()))
blist = list(map(int,input().split()))
clist = list(map(int,input().split()))
ans = 0
alist.sort(reverse=True)
alist = list(itertools.accumulate(alist))
for i in itertools.product([0,1],repeat=m):
    temp = 0
    we = 0
    for j in range(m):
        if i[j]:
            temp += clist[j]
            we += blist[j]
    res = w - we
    if res >= n:
        temp += alist[-1]
    elif res >= 1:
        temp += alist[res-1]
    if we <= w:
        ans = max(ans,temp)

print(ans)