from collections import defaultdict, deque, Counter import copy from itertools import combinations, permutations, product, accumulate, groupby, chain from heapq import heapify, heappop, heappush import math import bisect from pprint import pprint from random import randint import sys # sys.setrecursionlimit(700000) input = lambda: sys.stdin.readline().rstrip('\n') inf = float('inf') mod1 = 10**9+7 mod2 = 998244353 def ceil_div(x, y): return -(-x//y) ################################################# def f(x): sc = SC[x] return sa*j + sb*x + sc*i def findMax(f, l, r): while r-l >= 3: c1 = l+(r-l)//3 c2 = r-(r-l)//3 if f(c1) > f(c2): r = c2 else: l = c1 return max(f(x) for x in range(l, r+1)) NA, NB, NC = map(int, input().split()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort(reverse=True) B.sort(reverse=True) C.sort(reverse=True) SA = [0]+list(accumulate(A)) SB = [0]+list(accumulate(B)) SC = [0]+list(accumulate(C)) ans = 0 for i in range(NA+1): sa = SA[i] for j in range(NB+1): sb = SB[j] ans = max(ans, findMax(f, 0, NC)) print(ans)