import sys input = sys.stdin.readline n=list(map(int,input().split())) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) tota=0 totb=0 totc=0 numa=0 numb=0 numc=0 A=[] for i in a: if i>=0: tota+=i numa+=1 else: A.append(i) B=[] for i in b: if i>=0: totb+=i numb+=1 else: B.append(i) C=[] for i in c: if i>=0: totc+=i numc+=1 else: C.append(i) A.sort() B.sort() C.sort() ans=tota*numb+totb*numc+totc*numa while True: flg=False if A: a=A[-1] tmp=(tota+a)*numb+totb*numc+totc*(numa+1) if ans<=tmp: ans=tmp tota+=a numa+=1 flg=True A.pop() if B: b=B[-1] tmp=(tota)*(numb+1)+(totb+b)*numc+totc*(numa) if ans<=tmp: ans=tmp totb+=b numb+=1 flg=True B.pop() if C: c=C[-1] tmp=(tota)*numb+totb*(numc+1)+(totc+c)*(numa) if ans<=tmp: ans=tmp totc+=c numc+=1 flg=True C.pop() if not flg: break print(ans)