import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd 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())) a.sort() a = a[::-1] cnt = [0] for i in range(n): cnt.append(cnt[-1] + a[i]) ans = 0 for bit in range(1<>i) & 1: ws += b[i] vs += c[i] if ws <= w: ans = max(ans, vs+cnt[min(len(cnt)-1,w-ws)]) print(ans)