from collections import defaultdict N,M,W=map(int,input().split()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) D=list(map(int,input().split())) ans=0 for bit0 in range(1<<(N+M)): tmp_ans=0 d=defaultdict(int) for i in range(N): if (bit0>>i)&1: tmp_ans+=B[i] d[A[i]]+=1 for j in range(M): if (bit0>>(N+j))&1: tmp_ans-=D[j] d[-C[j]]+=1 test0=[] test1=[] for w in range(1,1+W): if w in d and -w in d: if d[w]>d[-w]: for _ in range(d[w]-d[-w]): test0.append(w) else: for _ in range(d[-w]-d[w]): test1.append(-w) elif w in d: for _ in range(d[w]): test0.append(w) elif -w in d: for _ in range(d[-w]): test1.append(-w) test0.sort() test1.sort(reverse=True) now=0 w_now=0 #print(test0,test1,bit0,bit1) dame=0 while True: if (now==0 and test0==[]) or (now==1 and test1==[]) or dame>=2: break if now==0: while True: if test0==[]: now=1 dame=0 break w=test0.pop() if w_now+w<=W: w_now+=w dame=0 else: test0.append(w) now=1 dame+=1 break else: while True: if test1==[]: now=0 dame=0 break w=test1.pop() if w_now+w>=0: w_now+=w dame=0 else: test1.append(w) now=0 dame+=1 break if test0==[] and test1==[] and 0<=w_now<=W: ans=max(ans,tmp_ans) print(ans)