import itertools def main(): n, m, w = [int(x) for x in input().split()] a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] c = [int(x) for x in input().split()] a.sort(reverse=True) ac = list(itertools.accumulate(a)) ac.insert(0, 0) bc = [[bc_i, (0, 0)] for bc_i in zip(b, c)] ans = 0 for ch in itertools.product(*bc): cap = 0 val = 0 for bi, ci in ch: cap += bi val += ci if cap > w: break if cap <= w: val += ac[min(n, w - cap)] ans = max(ans, val) print(ans) if __name__ == "__main__": main()