You are given three multisets of pairs of colored sticks:   $R$ pairs of red sticks, the first pair has length $r_1$, the second pair has length $r_2$, $\dots$, the $R$-th pair has length $r_R$;  $G$ pairs of green sticks, the first pair has length $g_1$, the second pair has length $g_2$, $\dots$, the $G$-th pair has length $g_G$;  $B$ pairs of blue sticks, the first pair has length $b_1$, the second pair has length $b_2$, $\dots$, the $B$-th pair has length $b_B$; 

You are constructing rectangles from these pairs of sticks with the following process:   take a pair of sticks of one color;  take a pair of sticks of another color different from the first one;  add the area of the resulting rectangle to the total area. 

Thus, you get such rectangles that their opposite sides are the same color and their adjacent sides are not the same color.

Each pair of sticks can be used at most once, some pairs can be left unused. You are not allowed to split a pair into independent sticks.

What is the maximum area you can achieve?


-----Input-----

The first line contains three integers $R$, $G$, $B$ ($1 \le R, G, B \le 200$) — the number of pairs of red sticks, the number of pairs of green sticks and the number of pairs of blue sticks.

The second line contains $R$ integers $r_1, r_2, \dots, r_R$ ($1 \le r_i \le 2000$) — the lengths of sticks in each pair of red sticks.

The third line contains $G$ integers $g_1, g_2, \dots, g_G$ ($1 \le g_i \le 2000$) — the lengths of sticks in each pair of green sticks.

The fourth line contains $B$ integers $b_1, b_2, \dots, b_B$ ($1 \le b_i \le 2000$) — the lengths of sticks in each pair of blue sticks.


-----Output-----

Print the maximum possible total area of the constructed rectangles.


-----Examples-----
Input
1 1 1
3
5
4

Output
20

Input
2 1 3
9 5
1
2 8 5

Output
99

Input
10 1 1
11 7 20 15 19 14 2 4 13 14
8
11

Output
372



-----Note-----

In the first example you can construct one of these rectangles: red and green with sides $3$ and $5$, red and blue with sides $3$ and $4$ and green and blue with sides $5$ and $4$. The best area of them is $4 \times 5 = 20$.

In the second example the best rectangles are: red/blue $9 \times 8$, red/blue $5 \times 5$, green/blue $2 \times 1$. So the total area is $72 + 25 + 2 = 99$.

In the third example the best rectangles are: red/green $19 \times 8$ and red/blue $20 \times 11$. The total area is $152 + 220 = 372$. Note that you can't construct more rectangles because you are not allowed to have both pairs taken to be the same color.

Source: codeforces | Difficulty: MEDIUM


Solutions:
import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s)
	sys.stdout.write('\n')

def wi(n):
	sys.stdout.write(str(n))
	sys.stdout.write('\n')

def wia(a, sep=' '):
	sys.stdout.write(sep.join([str(x) for x in a]))
	sys.stdout.write('\n')

def solve(r, g, b, ra, ga, ba):
	ra.sort(reverse=True)
	ga.sort(reverse=True)
	ba.sort(reverse=True)
	dp = [[[0] * (b + 1) for j in range(g + 1)] for i in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i < r and j < g:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + ra[i] * ga[j])
				if i < r and k < b:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + ra[i] * ba[k])
				if j < g and k < b:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + ga[j] * ba[k])
	ans = 0
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				ans = max(ans, dp[i][j][k])
	return ans

def main():
	(r, g, b) = ria()
	ra = ria()
	ga = ria()
	ba = ria()
	wi(solve(r, g, b, ra, ga, ba))
main()


(a, b, c) = map(int, input().split(' '))
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b1 = list(map(int, input().split()))
r = sorted(r, reverse=True)
g = sorted(g, reverse=True)
b1 = sorted(b1, reverse=True)
dp = [[[0 for i in range(c + 1)] for j in range(b + 1)] for k in range(a + 1)]
for i in range(1, a + 1):
	for j in range(1, b + 1):
		dp[i][j][0] = max(dp[i][j][0], dp[i - 1][j - 1][0] + r[i - 1] * g[j - 1])
for i in range(1, a + 1):
	for j in range(1, c + 1):
		dp[i][0][j] = max(dp[i][0][j], dp[i - 1][0][j - 1] + r[i - 1] * b1[j - 1])
for i in range(1, b + 1):
	for j in range(1, c + 1):
		dp[0][i][j] = max(dp[0][i][j], dp[0][i - 1][j - 1] + b1[j - 1] * g[i - 1])
maxa = 0
for i in range(1, a + 1):
	for j in range(1, b + 1):
		for k in range(1, c + 1):
			dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1], dp[i - 1][j][k - 1] + r[i - 1] * b1[k - 1], dp[i][j - 1][k - 1] + g[j - 1] * b1[k - 1])
			maxa = max(maxa, dp[i][j][k])
print(maxa)


import sys

def input():
	return sys.stdin.readline().rstrip()

def input_split():
	return [int(i) for i in input().split()]
(x, y, z) = input_split()
arr_x = input_split()
arr_y = input_split()
arr_z = input_split()
x += 1
y += 1
z += 1
lengths = [x, y, z]
arrs = [arr_x, arr_y, arr_z]
for a in arrs:
	a.sort()
dp = [[[0 for k in range(z)] for j in range(y)] for i in range(x)]
for i in range(1, x):
	for j in range(1, y):
		dp[i][j][0] = dp[i - 1][j - 1][0] + arr_x[i - 1] * arr_y[j - 1]
for j in range(1, y):
	for k in range(1, z):
		dp[0][j][k] = dp[0][j - 1][k - 1] + arr_y[j - 1] * arr_z[k - 1]
for i in range(1, x):
	for k in range(1, z):
		dp[i][0][k] = dp[i - 1][0][k - 1] + arr_x[i - 1] * arr_z[k - 1]
for i in range(1, x):
	for j in range(1, y):
		for k in range(1, z):
			opt1 = dp[i - 1][j - 1][k] + arr_x[i - 1] * arr_y[j - 1]
			opt2 = dp[i][j - 1][k - 1] + arr_y[j - 1] * arr_z[k - 1]
			opt3 = dp[i - 1][j][k - 1] + arr_x[i - 1] * arr_z[k - 1]
			dp[i][j][k] = max(opt1, opt2, opt3)
ans = dp[x - 1][y - 1][z - 1]
print(ans)


import sys
read = lambda : sys.stdin.readline().strip()
(rn, gn, bn) = map(int, read().split())
reds = sorted(map(int, read().split()), reverse=True)
greens = sorted(map(int, read().split()), reverse=True)
blues = sorted(map(int, read().split()), reverse=True)
dp = [[[0 for _ in range(bn + 1)] for _ in range(gn + 1)] for _ in range(rn + 1)]
ans = 0
for i in range(rn + 1):
	for j in range(gn + 1):
		for k in range(bn + 1):
			if i < rn and j < gn:
				dp[i + 1][j + 1][k] = max(reds[i] * greens[j] + dp[i][j][k], dp[i + 1][j + 1][k])
			if k < bn and j < gn:
				dp[i][j + 1][k + 1] = max(blues[k] * greens[j] + dp[i][j][k], dp[i][j + 1][k + 1])
			if i < rn and k < bn:
				dp[i + 1][j][k + 1] = max(reds[i] * blues[k] + dp[i][j][k], dp[i + 1][j][k + 1])
			ans = max(dp[i][j][k], ans)
print(ans)


(r, g, b) = map(int, input().split())
ra = list(map(int, input().split()))
ga = list(map(int, input().split()))
ba = list(map(int, input().split()))
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
ra.sort(reverse=1)
ga.sort(reverse=1)
ba.sort(reverse=1)
ans = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + ra[i] * ga[j])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + ra[i] * ba[k])
			if k < b and j < g:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + ba[k] * ga[j])
			ans = max(ans, dp[i][j][k])
print(ans)


import os
import sys
from io import BytesIO, IOBase
from functools import lru_cache
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
(r, g, b) = list(map(int, sys.stdin.readline().lstrip().rstrip().split()))
arr = list(map(int, sys.stdin.readline().lstrip().rstrip().split()))
brr = list(map(int, sys.stdin.readline().lstrip().rstrip().split()))
crr = list(map(int, sys.stdin.readline().lstrip().rstrip().split()))
arr.sort(reverse=True)
brr.sort(reverse=True)
crr.sort(reverse=True)
dp = [[[-1] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]

def func(i, j, k):
	if i == r and j == g and (k == b):
		return 0
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	ans = 0
	if i < r and j < g:
		ans = max(ans, arr[i] * brr[j] + func(i + 1, j + 1, k))
	if j < g and k < b:
		ans = max(ans, brr[j] * crr[k] + func(i, j + 1, k + 1))
	if k < b and i < r:
		ans = max(ans, arr[i] * crr[k] + func(i + 1, j, k + 1))
	dp[i][j][k] = ans
	return ans
sys.stdout.write(str(func(0, 0, 0)) + '\n')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
dp = [[[-1 for i in range(201)] for j in range(201)] for k in range(201)]

def rec(a, b, c, rind, gind, bind):
	if rind < 0 and bind < 0 and (gind < 0):
		return 0
	if dp[rind][gind][bind] != -1:
		return dp[rind][gind][bind]
	temp1 = 0
	temp2 = 0
	temp3 = 0
	if rind >= 0 and gind >= 0:
		temp1 = a[rind] * b[gind] + rec(a, b, c, rind - 1, gind - 1, bind)
	if gind >= 0 and bind >= 0:
		temp2 = b[gind] * c[bind] + rec(a, b, c, rind, gind - 1, bind - 1)
	if rind >= 0 and bind >= 0:
		temp3 = a[rind] * c[bind] + rec(a, b, c, rind - 1, gind, bind - 1)
	dp[rind][gind][bind] = max(temp1, temp2, temp3)
	return dp[rind][gind][bind]

def solve():
	(rn, gn, bn) = sep()
	a = sorted(lis())
	b = sorted(lis())
	c = sorted(lis())
	rind = rn - 1
	gind = gn - 1
	bind = bn - 1
	print(rec(a, b, c, rind, gind, bind))
testcase(1)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass
global ans
ans = 0

def rec(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	x1 = x2 = x3 = 0
	if i < R and j < G:
		x1 = r[i] * g[j] + rec(i + 1, j + 1, k)
	if i < R and k < B:
		x2 = r[i] * b[k] + rec(i + 1, j, k + 1)
	if j < G and k < B:
		x3 = g[j] * b[k] + rec(i, j + 1, k + 1)
	dp[i][j][k] = max(x1, x2, x3)
	global ans
	ans = max(ans, dp[i][j][k])
	return dp[i][j][k]
for _ in range(1):
	(R, G, B) = L()
	r = L()
	g = L()
	b = L()
	r.sort(reverse=True)
	g.sort(reverse=True)
	b.sort(reverse=True)
	dp = [[[-1 for k in range(B + 1)] for j in range(G + 1)] for i in range(R + 1)]
	rec(0, 0, 0)
	print(ans)
endtime = time.time()


from itertools import product
(nr, ng, nb) = map(int, input().split())
R = list(map(int, input().split()))
R.sort(reverse=True)
G = list(map(int, input().split()))
G.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
dp = [[[0] * (nb + 1) for _ in range(ng + 1)] for _ in range(nr + 1)]
mx = 0
for (r, g, b) in product(range(nr + 1), range(ng + 1), range(nb + 1)):
	if r > 0 and g > 0:
		dp[r][g][b] = max(dp[r][g][b], dp[r - 1][g - 1][b] + R[r - 1] * G[g - 1])
	if g > 0 and b > 0:
		dp[r][g][b] = max(dp[r][g][b], dp[r][g - 1][b - 1] + G[g - 1] * B[b - 1])
	if r > 0 and b > 0:
		dp[r][g][b] = max(dp[r][g][b], dp[r - 1][g][b - 1] + R[r - 1] * B[b - 1])
	mx = max(mx, dp[r][g][b])
print(mx)


(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort()
g.sort()
b.sort()
dp = [[[0] * 202 for i in range(202)] for j in range(202)]
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if k and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[R][G][B])


import os
import heapq
import sys
import math
import operator
from collections import defaultdict
from io import BytesIO, IOBase

def inpt():
	return [int(k) for k in input().split()]

def main():
	(n1, n2, n3) = map(int, input().split())
	ar = [int(x) for x in input().split()]
	br = [int(x) for x in input().split()]
	cr = [int(x) for x in input().split()]
	ar.sort()
	br.sort()
	cr.sort()
	dp = [[[0 for x in range(201)] for y in range(201)] for z in range(201)]
	for i in range(n1 + 1):
		for j in range(n2 + 1):
			for k in range(n3 + 1):
				if i and j:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + ar[i - 1] * br[j - 1])
				if i and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + ar[i - 1] * cr[k - 1])
				if k and j:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + cr[k - 1] * br[j - 1])
	print(dp[n1][n2][n3])
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


(R, G, B) = list(map(int, input().split()))
r = sorted([int(x) for x in input().split()], reverse=True)
g = sorted([int(x) for x in input().split()], reverse=True)
b = sorted([int(x) for x in input().split()], reverse=True)
ans = 0
dp = [[[0 for i in range(B + 1)] for j in range(G + 1)] for k in range(R + 1)]
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i < R and j < G:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
			if j < G and k < B:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
			if i < R and k < B:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + r[i] * b[k])
			ans = max(ans, dp[i][j][k])
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class union_find:

	def __init__(self, n):
		self.n = n
		self.rank = [0] * n
		self.parent = [int(j) for j in range(n)]

	def union(self, i, j):
		i = self.find(i)
		j = self.find(j)
		if self.rank[i] == self.rank[j]:
			self.parent[i] = j
			self.rank[j] += 1
		elif self.rank[i] > self.rank[j]:
			self.parent[j] = i
		else:
			self.parent[i] = j

	def find(self, i):
		temp = i
		if self.parent[temp] != temp:
			self.parent[temp] = self.find(self.parent[temp])
		return self.parent[temp]
from math import log2, ceil
from collections import deque, Counter as CC, defaultdict as dd

def main():
	(p, q, r) = [int(j) for j in input().split()]
	a = [int(j) for j in input().split()]
	b = [int(j) for j in input().split()]
	c = [int(j) for j in input().split()]
	a.sort()
	b.sort()
	c.sort()
	l = [a, b, c]
	dp = [[[0 for i in range(r + 1)] for j in range(q + 1)] for k in range(p + 1)]
	for i in range(p + 1):
		for j in range(q + 1):
			for k in range(r + 1):
				s = [i - 1, j - 1, k - 1]
				for u in range(3):
					s[u] += 1
					try:
						tmp = dp[s[0]][s[1]][s[2]]
					except:
						s[u] -= 1
						continue
					tmp2 = 1
					flag = True
					for t in range(3):
						if u != t:
							if s[t] == -1:
								flag = False
								break
							tmp2 *= l[t][s[t]]
					tmp += tmp2
					s[u] -= 1
					if flag:
						dp[i][j][k] = max(dp[i][j][k], tmp)
	print(dp[p][q][r])
main()


import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
ns = lambda : readline().rstrip()
ni = lambda : int(readline().rstrip())
nm = lambda : map(int, readline().split())
nl = lambda : list(map(int, readline().split()))
(r, g, b) = nm()
R = nl()
G = nl()
B = nl()
dp = [[[-1 for i in range(b + 1)] for i in range(g + 1)] for i in range(r + 1)]
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
R.insert(0, 0)
G.insert(0, 0)
B.insert(0, 0)
(dp[0][0][0], ans) = (0, 0)
for i in range(0, r + 1):
	for j in range(0, g + 1):
		for k in range(0, b + 1):
			if i == 0 and j == 0 and (k == 0):
				continue
			if i and j and (dp[i - 1][j - 1][k] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i] * G[j])
			if k and j and (dp[i][j - 1][k - 1] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + B[k] * G[j])
			if i and k and (dp[i - 1][j][k - 1] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i] * B[k])
			ans = max(ans, dp[i][j][k])
print(ans)


import pprint
(nr, ng, nb) = map(int, input().split())
(*r,) = map(int, input().split())
(*g,) = map(int, input().split())
(*b,) = map(int, input().split())
dp = []
for _ in range(nr + 1):
	dp.append([[0] * (nb + 1) for _ in range(ng + 1)])
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
mx = 0
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
mx_i = mx_j = mx_k = -1
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			if dp[i][j][k] > mx:
				mx_i = i
				mx_j = j
				mx_k = k
				mx = dp[i][j][k]
print(mx)


(re, ge, be) = list(map(int, input().split()))
R = [0] + list(map(int, input().split()))
G = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))
R.sort()
G.sort()
B.sort()
dp = []
for i in range(re + 1):
	d = []
	for g in range(ge + 1):
		c = []
		for j in range(be + 1):
			c.append(0)
		d.append(c)
	dp.append(d)
for i in range(re + 1):
	for g in range(ge + 1):
		for j in range(be + 1):
			if i and g:
				dp[i][g][j] = max(dp[i][g][j], dp[i - 1][g - 1][j] + R[i] * G[g])
			if i and j:
				dp[i][g][j] = max(dp[i][g][j], dp[i - 1][g][j - 1] + R[i] * B[j])
			if g and j:
				dp[i][g][j] = max(dp[i][g][j], dp[i][g - 1][j - 1] + G[g] * B[j])
print(dp[re][ge][be])


import heapq

def read_int():
	return int(input().strip())

def read_ints():
	return list(map(int, input().strip().split(' ')))

def solve():
	(R, G, B) = read_ints()
	dp = [[[0 for _ in range(B + 1)] for _ in range(G + 1)] for _ in range(R + 1)]
	Rs = read_ints()
	Gs = read_ints()
	Bs = read_ints()
	Rs.sort(reverse=True)
	Gs.sort(reverse=True)
	Bs.sort(reverse=True)
	answer = 0
	for r in range(R + 1):
		for g in range(G + 1):
			for b in range(B + 1):
				if r > 0 and g > 0:
					dp[r][g][b] = max(dp[r][g][b], dp[r - 1][g - 1][b] + Rs[r - 1] * Gs[g - 1])
				if g > 0 and b > 0:
					dp[r][g][b] = max(dp[r][g][b], dp[r][g - 1][b - 1] + Gs[g - 1] * Bs[b - 1])
				if r > 0 and b > 0:
					dp[r][g][b] = max(dp[r][g][b], dp[r - 1][g][b - 1] + Rs[r - 1] * Bs[b - 1])
				answer = max(answer, dp[r][g][b])
	return answer
print(solve())


(nr, ng, nb) = map(int, input().split())
r = sorted(list(map(int, input().split())), reverse=True)
g = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
dp = [[[0 for i in range(nb + 1)] for i in range(ng + 1)] for i in range(nr + 1)]
ans = 0
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			if i < nr and j < ng:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
			if i < nr and k < nb:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + r[i] * b[k])
			if j < ng and k < nb:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
			ans = max(ans, dp[i][j][k])
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(r, g, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))
l1.sort(reverse=True)
l2.sort(reverse=True)
l3.sort(reverse=True)
dp = [[['*' for cc1 in range(b + 1)] for cc2 in range(g + 1)] for r in range(r + 1)]
ans = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i == 0 and j == 0:
				dp[i][j][k] = 0
			if j == 0 and k == 0:
				dp[i][j][k] = 0
			if i == 0 and k == 0:
				dp[i][j][k] = 0
			if i > 0 and j > 0 and (k > 0):
				dp[i][j][k] = max(l1[i - 1] * l2[j - 1] + dp[i - 1][j - 1][k], l1[i - 1] * l3[k - 1] + dp[i - 1][j][k - 1], l2[j - 1] * l3[k - 1] + dp[i][j - 1][k - 1])
			elif i > 0 and j > 0:
				dp[i][j][k] = l1[i - 1] * l2[j - 1] + dp[i - 1][j - 1][k]
			elif i > 0 and k > 0:
				dp[i][j][k] = l1[i - 1] * l3[k - 1] + dp[i - 1][j][k - 1]
			elif j > 0 and k > 0:
				dp[i][j][k] = l2[j - 1] * l3[k - 1] + dp[i][j - 1][k - 1]
			ans = max(ans, dp[i][j][k])
print(ans)


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
from fractions import Fraction
INF = float('inf')
mod = int(1000000000.0) + 7

def recur(r, g, b):
	if r + b + g == r or r + b + g == g or r + b + g == b:
		return 0
	if dp[r][g][b]:
		return dp[r][g][b]
	if r > 0 and g > 0:
		dp[r][g][b] = max(dp[r][g][b], R[r - 1] * G[g - 1] + recur(r - 1, g - 1, b))
	if r > 0 and b > 0:
		dp[r][g][b] = max(dp[r][g][b], R[r - 1] * B[b - 1] + recur(r - 1, g, b - 1))
	if b > 0 and g > 0:
		dp[r][g][b] = max(dp[r][g][b], B[b - 1] * G[g - 1] + recur(r, g - 1, b - 1))
	return dp[r][g][b]
(r, g, b) = mdata()
R = sorted(mdata())
G = sorted(mdata())
B = sorted(mdata())
dp = [[[0] * (b + 1) for i in range(g + 1)] for i in range(r + 1)]
out(recur(r, g, b))


import threading, sys

def dp(ra, ga, ba, r, g, b, d):
	if d[r][g][b] != -1:
		return d[r][g][b]
	elif [r, g, b].count(0) >= 2:
		return 0
	elif [r, g, b].count(0) == 1:
		if not r:
			d[r][g][b] = ga[g - 1] * ba[b - 1] + dp(ra, ga, ba, r, g - 1, b - 1, d)
			return d[r][g][b]
		if not b:
			d[r][g][b] = ga[g - 1] * ra[r - 1] + dp(ra, ga, ba, r - 1, g - 1, b, d)
			return d[r][g][b]
		if not g:
			d[r][g][b] = ra[r - 1] * ba[b - 1] + dp(ra, ga, ba, r - 1, g, b - 1, d)
			return d[r][g][b]
	else:
		d[r][g][b] = max([ga[g - 1] * ba[b - 1] + dp(ra, ga, ba, r, g - 1, b - 1, d), ga[g - 1] * ra[r - 1] + dp(ra, ga, ba, r - 1, g - 1, b, d), ra[r - 1] * ba[b - 1] + dp(ra, ga, ba, r - 1, g, b - 1, d)])
		return d[r][g][b]

def main():
	(r, g, b) = map(int, input().split())
	ra = list(map(int, input().split()))
	ga = list(map(int, input().split()))
	ba = list(map(int, input().split()))
	(ra.sort(), ga.sort(), ba.sort())
	d = [[[-1] * (b + 1) for j in range(g + 1)] for i in range(r + 1)]
	print(dp(ra, ga, ba, r, g, b, d))
main()


(R, G, B) = [int(c) for c in input().split()]
ra = [int(c) for c in input().split()]
ga = [int(c) for c in input().split()]
ba = [int(c) for c in input().split()]
ra.sort(reverse=True)
ga.sort(reverse=True)
ba.sort(reverse=True)
dp = [[[-1 for i in range(201)] for j in range(201)] for k in range(201)]

def solve(dp, r, g, b):
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	count = 0
	for (i, j) in zip((r, g, b), (R, G, B)):
		if i == j:
			count += 1
	if count >= 2:
		return 0
	res = -999
	if r != R and b != B:
		res = max(res, ra[r] * ba[b] + solve(dp, r + 1, g, b + 1))
	if r != R and g != G:
		res = max(res, ra[r] * ga[g] + solve(dp, r + 1, g + 1, b))
	if b != B and g != G:
		res = max(res, ba[b] * ga[g] + solve(dp, r, g + 1, b + 1))
	dp[r][g][b] = res
	return res
print(solve(dp, 0, 0, 0))


from collections import defaultdict

def main():
	(R, G, B) = map(int, input().split())
	red = list(map(int, input().split()))
	green = list(map(int, input().split()))
	blue = list(map(int, input().split()))
	red.sort(reverse=True)
	green.sort(reverse=True)
	blue.sort(reverse=True)
	dp = [[[-2 * 10 ** 9] * (B + 10) for i in range(G + 10)] for j in range(R + 10)]
	dp[0][0][0] = 0
	ans = 0
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + red[i - 1] * green[j - 1], dp[i][j - 1][k - 1] + green[j - 1] * blue[k - 1], dp[i - 1][j][k - 1] + red[i - 1] * blue[k - 1])
				ans = max(ans, dp[i][j][k])
	print(ans)
	return
main()


import sys

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 9
MOD = 10 ** 9 + 7
(N, M, L) = MAP()
R = LIST()
G = LIST()
B = LIST()
R.sort(reverse=1)
G.sort(reverse=1)
B.sort(reverse=1)
dp = list3d(N + 1, M + 1, L + 1, -INF)
dp[0][0][0] = 0
for i in range(N + 1):
	for j in range(M + 1):
		for k in range(L + 1):
			if i < N and j < M:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + R[i] * G[j])
			if j < M and k < L:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + G[j] * B[k])
			if i < N and k < L:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + R[i] * B[k])
ans = 0
for i in range(N + 1):
	for j in range(M + 1):
		for k in range(L + 1):
			ans = max(ans, dp[i][j][k])
print(ans)


import sys
from math import sqrt, gcd, ceil, log, floor
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

def main():
	(r, g, b) = read()
	r_ar = sorted(read(), reverse=True)
	g_ar = sorted(read(), reverse=True)
	b_ar = sorted(read(), reverse=True)
	N = 201
	dp = [[[-1] * N for i in range(N)] for j in range(N)]

	def f(x, y, z):
		if (x >= r) + (y >= g) + (z >= b) >= 2:
			return 0
		if dp[x][y][z] != -1:
			return dp[x][y][z]
		maxi = 0
		if x < r and y < g:
			maxi = max(maxi, r_ar[x] * g_ar[y] + f(x + 1, y + 1, z))
		if z < b and y < g:
			maxi = max(maxi, b_ar[z] * g_ar[y] + f(x, y + 1, z + 1))
		if x < r and z < b:
			maxi = max(maxi, r_ar[x] * b_ar[z] + f(x + 1, y, z + 1))
		dp[x][y][z] = maxi
		return maxi
	print(f(0, 0, 0))
main()


from sys import stdin
inp = lambda : stdin.readline().strip()
(nr, ng, nb) = [int(x) for x in inp().split()]
r = [int(x) for x in inp().split()]
g = [int(x) for x in inp().split()]
b = [int(x) for x in inp().split()]
r.sort()
g.sort()
b.sort()
dp = [[[0 for _ in range(201)] for _ in range(201)] for _ in range(201)]
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[nr][ng][nb])


def solve(r, g, b, rs, gs, bs):
	rs.sort(reverse=True)
	gs.sort(reverse=True)
	bs.sort(reverse=True)
	dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
	sol = 0
	for ri in range(r + 1):
		for gi in range(g + 1):
			for bi in range(b + 1):
				if ri < r and gi < g:
					dp[ri + 1][gi + 1][bi] = max(dp[ri + 1][gi + 1][bi], rs[ri] * gs[gi] + dp[ri][gi][bi])
				if ri < r and bi < b:
					dp[ri + 1][gi][bi + 1] = max(dp[ri + 1][gi][bi + 1], rs[ri] * bs[bi] + dp[ri][gi][bi])
				if gi < g and bi < b:
					dp[ri][gi + 1][bi + 1] = max(dp[ri][gi + 1][bi + 1], gs[gi] * bs[bi] + dp[ri][gi][bi])
				sol = max(sol, dp[ri][gi][bi])
	return sol
(r, g, b) = map(int, input().split())
rs = list(map(int, input().split()))
gs = list(map(int, input().split()))
bs = list(map(int, input().split()))
print(solve(r, g, b, rs, gs, bs))


import sys
input = sys.stdin.readline
from collections import *
(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = [[[0] * (len(b) + 1) for _ in range(len(g) + 1)] for _ in range(len(r) + 1)]
for i in range(len(r) + 1):
	for j in range(len(g) + 1):
		for k in range(len(b) + 1):
			if i + 1 <= len(r) and j + 1 <= len(g):
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
			if j + 1 <= len(g) and k + 1 <= len(b):
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
			if i + 1 <= len(r) and k + 1 <= len(b):
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + r[i] * b[k])
ans = 0
for i in range(len(r) + 1):
	for j in range(len(g) + 1):
		for k in range(len(b) + 1):
			ans = max(ans, dp[i][j][k])
print(ans)


import os, sys
from io import BytesIO, IOBase
from collections import Counter
from time import time
r = g = b = R = G = B = arr = 0

def rec(x, y, z):
	global arr, r, g, b, R, G, B
	if arr[x][y][z]:
		return arr[x][y][z]
	if x * y > 0:
		arr[x][y][z] = max(rec(x - 1, y - 1, z) + r[x - 1] * g[y - 1], arr[x][y][z])
	if y * z > 0:
		arr[x][y][z] = max(rec(x, y - 1, z - 1) + g[y - 1] * b[z - 1], arr[x][y][z])
	if x * z > 0:
		arr[x][y][z] = max(rec(x - 1, y, z - 1) + r[x - 1] * b[z - 1], arr[x][y][z])
	return arr[x][y][z]

def main():
	global arr, r, g, b, R, G, B
	(R, G, B) = map(int, input().split())
	r = sorted(list(map(int, input().split())))
	g = sorted(list(map(int, input().split())))
	b = sorted(list(map(int, input().split())))
	arr = [[[0] * (B + 1) for _ in range(G + 1)] for _ in range(R + 1)]
	print(rec(R, G, B))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def f(l, r, g, b, op):
	if r == 0 and g == 0 or (r == 0 and b == 0) or (b == 0 and g == 0):
		return 0
	else:
		if op[r][g][b] != -1:
			return op[r][g][b]
		if r == 0:
			op[r][g][b] = l[1][g - 1] * l[2][b - 1] + f(l, r, g - 1, b - 1, op)
			return op[r][g][b]
		if g == 0:
			op[r][g][b] = l[0][r - 1] * l[2][b - 1] + f(l, r - 1, g, b - 1, op)
			return op[r][g][b]
		if b == 0:
			op[r][g][b] = l[0][r - 1] * l[1][g - 1] + f(l, r - 1, g - 1, b, op)
			return op[r][g][b]
		op[r][g][b] = max(l[1][g - 1] * l[2][b - 1] + f(l, r, g - 1, b - 1, op), l[0][r - 1] * l[2][b - 1] + f(l, r - 1, g, b - 1, op), l[0][r - 1] * l[1][g - 1] + f(l, r - 1, g - 1, b, op))
		return op[r][g][b]
(r, g, b) = list(map(int, input().split()))
l = []
l.append(sorted(list(map(int, input().split()))))
l.append(sorted(list(map(int, input().split()))))
l.append(sorted(list(map(int, input().split()))))
op = [[[-1 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
print(f(l, r, g, b, op))


def main():
	(R, G, B) = map(int, input().split())
	Rs = list(map(int, input().split()))
	Gs = list(map(int, input().split()))
	Bs = list(map(int, input().split()))
	Rs.sort(reverse=True)
	Gs.sort(reverse=True)
	Bs.sort(reverse=True)
	dp = [[[0] * (B + 1) for _ in range(G + 1)] for _ in range(R + 1)]
	ans = 0
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				t = 0
				if i > 0 and j > 0:
					if dp[i - 1][j - 1][k] + Rs[i - 1] * Gs[j - 1] > t:
						t = dp[i - 1][j - 1][k] + Rs[i - 1] * Gs[j - 1]
				if j > 0 and k > 0:
					if dp[i][j - 1][k - 1] + Gs[j - 1] * Bs[k - 1] > t:
						t = dp[i][j - 1][k - 1] + Gs[j - 1] * Bs[k - 1]
				if k > 0 and i > 0:
					if dp[i - 1][j][k - 1] + Bs[k - 1] * Rs[i - 1] > t:
						t = dp[i - 1][j][k - 1] + Bs[k - 1] * Rs[i - 1]
				dp[i][j][k] = t
				if ans < t:
					ans = t
	print(ans)
main()


from bisect import *
from collections import *
from math import gcd, ceil, sqrt, floor, inf
from heapq import *
from itertools import *
from operator import add, mul, sub, xor, truediv, floordiv
from functools import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc
farr = [1]
ifa = []

def fact(x, mod=0):
	if mod:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr) % mod)
	else:
		while x >= len(farr):
			farr.append(farr[-1] * len(farr))
	return farr[x]

def ifact(x, mod):
	global ifa
	ifa.append(pow(farr[-1], mod - 2, mod))
	for i in range(x, 0, -1):
		ifa.append(ifa[-1] * i % mod)
	ifa = ifa[::-1]

def per(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return fact(i) // fact(i - j)
	return farr[i] * ifa[i - j] % mod

def com(i, j, mod=0):
	if i < j:
		return 0
	if not mod:
		return per(i, j) // fact(j)
	return per(i, j, mod) * ifa[j] % mod

def catalan(n):
	return com(2 * n, n) // (n + 1)

def linc(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t > f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rinc(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t < f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def ldec(f, t, l, r):
	while l < r:
		mid = (l + r) // 2
		if t < f(mid):
			l = mid + 1
		else:
			r = mid
	return l

def rdec(f, t, l, r):
	while l < r:
		mid = (l + r + 1) // 2
		if t > f(mid):
			r = mid - 1
		else:
			l = mid
	return l

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def binfun(x):
	c = 0
	for w in arr:
		c += ceil(w / x)
	return c

def lowbit(n):
	return n & -n

def inverse(a, m):
	a %= m
	if a <= 1:
		return a
	return (1 - inverse(m, a) * m) // a % m

class BIT:

	def __init__(self, arr):
		self.arr = arr
		self.n = len(arr) - 1

	def update(self, x, v):
		while x <= self.n:
			self.arr[x] += v
			x += x & -x

	def query(self, x):
		ans = 0
		while x:
			ans += self.arr[x]
			x &= x - 1
		return ans

class DSU:

	def __init__(self, n):
		self.c = [-1] * n

	def same(self, x, y):
		return self.find(x) == self.find(y)

	def find(self, x):
		if self.c[x] < 0:
			return x
		self.c[x] = self.find(self.c[x])
		return self.c[x]

	def union(self, u, v):
		(u, v) = (self.find(u), self.find(v))
		if u == v:
			return False
		if self.c[u] < self.c[v]:
			(u, v) = (v, u)
		self.c[u] += self.c[v]
		self.c[v] = u
		return True

	def size(self, x):
		return -self.c[self.find(x)]

class UFS:

	def __init__(self, n):
		self.parent = [i for i in range(n)]
		self.ranks = [0] * n

	def find(self, x):
		if x != self.parent[x]:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, u, v):
		(pu, pv) = (self.find(u), self.find(v))
		if pu == pv:
			return False
		if self.ranks[pu] >= self.ranks[pv]:
			self.parent[pv] = pu
			if self.ranks[pv] == self.ranks[pu]:
				self.ranks[pu] += 1
		else:
			self.parent[pu] = pv

def Prime(n):
	c = 0
	prime = []
	flag = [0] * (n + 1)
	for i in range(2, n + 1):
		if not flag[i]:
			prime.append(i)
			c += 1
		for j in range(c):
			if i * prime[j] > n:
				break
			flag[i * prime[j]] = prime[j]
			if i % prime[j] == 0:
				break
	return prime

def dij(s, graph):
	d = {}
	d[s] = 0
	heap = [(0, s)]
	seen = set()
	while heap:
		(dis, u) = heappop(heap)
		if u in seen:
			continue
		for v in graph[u]:
			if v not in d or d[v] > d[u] + graph[u][v]:
				d[v] = d[u] + graph[u][v]
				heappush(heap, (d[v], v))
	return d

def GP(it):
	return [(ch, len(list(g))) for (ch, g) in groupby(it)]

class DLN:

	def __init__(self, val):
		self.val = val
		self.pre = None
		self.next = None
t = 1
for i in range(t):
	(x, y, z) = RL()
	r = RLL()
	g = RLL()
	b = RLL()
	dp = [[[0] * (z + 1) for i in range(y + 1)] for j in range(x + 1)]
	r.sort()
	g.sort()
	b.sort()
	for i in range(x + 1):
		for j in range(y + 1):
			for k in range(z + 1):
				if i and j:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
				if i and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
				if j and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
	print(dp[-1][-1][-1])


def cal(r, g, b):
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	area = 0
	if r < R and g < G:
		area = max(area, rl[r] * gl[g] + cal(r + 1, g + 1, b))
	if r < R and b < B:
		area = max(area, rl[r] * bl[b] + cal(r + 1, g, b + 1))
	if g < G and b < B:
		area = max(area, gl[g] * bl[b] + cal(r, g + 1, b + 1))
	dp[r][g][b] = area
	return area
(R, G, B) = map(int, input().split())
rl = sorted(list(map(int, input().split())), reverse=True)
gl = sorted(list(map(int, input().split())), reverse=True)
bl = sorted(list(map(int, input().split())), reverse=True)
dp = [[[-1] * (B + 1) for i in range(G + 1)] for i in range(R + 1)]
print(cal(0, 0, 0))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import ceil, floor
from copy import *
from collections import deque, defaultdict
from collections import Counter as counter
from itertools import combinations
from itertools import permutations as permutate
from bisect import bisect_left as bl
from operator import *
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192
from sys import stderr

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def pow(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def gcd(a, b):
	if a == b:
		return a
	while b > 0:
		(a, b) = (b, a % b)
	return a

def prefix_sum(ar):
	return list(accumulate(ar))

def suffix_sum(ar):
	return list(accumulate(ar[::-1]))[::-1]

def N():
	return int(inp())
dx = [0, 0, 1, -1]
dy = [1, -1, 0, 0]

def YES():
	print('YES')

def NO():
	print('NO')

def Yes():
	print('Yes')

def No():
	print('No')
from collections import defaultdict

def numberOfSetBits(i):
	i = i - (i >> 1 & 1431655765)
	i = (i & 858993459) + (i >> 2 & 858993459)
	return ((i + (i >> 4) & 252645135) * 16843009 & 4294967295) >> 24

class MergeFind:

	def __init__(self, n):
		self.parent = list(range(n))
		self.size = [1] * n
		self.num_sets = n

	def find(self, a):
		to_update = []
		while a != self.parent[a]:
			to_update.append(a)
			a = self.parent[a]
		for b in to_update:
			self.parent[b] = a
		return self.parent[a]

	def merge(self, a, b):
		a = self.find(a)
		b = self.find(b)
		if a == b:
			return
		self.num_sets -= 1
		self.parent[a] = b
		self.size[b] += self.size[a]

	def set_size(self, a):
		return self.size[self.find(a)]

	def __len__(self):
		return self.num_sets

def lcm(a, b):
	return abs(a // gcd(a, b) * b)

def solve():
	(R, G, B) = sep()
	r = lis()
	g = lis()
	b = lis()
	r.sort(reverse=True)
	g.sort(reverse=True)
	b.sort(reverse=True)
	dp = [[[0] * (B + 1) for _ in range(G + 1)] for i in range(R + 1)]
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				if i and j and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
					continue
				if i and j:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
					continue
				if i and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
					continue
				if j and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + b[k - 1] * g[j - 1])
					continue
	m = 0
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				m = max(m, dp[i][j][k])
	print(m)
solve()


from functools import lru_cache
from sys import stdin, stdout
input = stdin.readline

def solve(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	call = 0
	if i > 0 and j > 0:
		call = max(call, R[i] * G[j] + solve(i - 1, j - 1, k))
	if j > 0 and k > 0:
		call = max(call, G[j] * B[k] + solve(i, j - 1, k - 1))
	if k > 0 and i > 0:
		call = max(call, B[k] * R[i] + solve(i - 1, j, k - 1))
	dp[i][j][k] = call
	return call
(nr, ng, nb) = map(int, input().split())
R = [0] + list(map(int, input().split()))
G = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))
R.sort()
G.sort()
B.sort()
dp = [[[-1 for k in range(nb + 1)] for j in range(ng + 1)] for i in range(nr + 1)]
ans = solve(nr, ng, nb)
print(ans)


(r, g, b) = map(int, input().split())
R = sorted([*map(int, input().split())], reverse=True)
G = sorted([*map(int, input().split())], reverse=True)
B = sorted([*map(int, input().split())], reverse=True)
mem = [[[-1 for i in range(201)] for j in range(201)] for j in range(201)]

def dp(i, j, k):
	p = (i == r) + (j == g) + (k == b)
	if p > 1:
		return 0
	if mem[i][j][k] != -1:
		return mem[i][j][k]
	ans = 0
	if i == r:
		ans = dp(i, j + 1, k + 1) + G[j] * B[k]
		return ans
	elif j == g:
		ans = dp(i + 1, j, k + 1) + R[i] * B[k]
	elif k == b:
		ans = dp(i + 1, j + 1, k) + R[i] * G[j]
	else:
		ans = max(dp(i + 1, j + 1, k) + R[i] * G[j], dp(i, j + 1, k + 1) + G[j] * B[k], dp(i + 1, j, k + 1) + R[i] * B[k])
	mem[i][j][k] = ans
	return ans
print(dp(0, 0, 0))


(R, G, B) = list(map(lambda x: int(x), input().split()))
r = list(map(lambda x: int(x), input().split()))
g = list(map(lambda x: int(x), input().split()))
b = list(map(lambda x: int(x), input().split()))

def f(t):
	(i, j, k) = t
	return (i + 1) * (G + 1) * (B + 1) + (j + 1) * (B + 1) + (k + 1)
max_area = [None] * ((R + 1) * (G + 1) * (B + 1) + 1)

def get_max_area(i, j, k):
	temp = f((i, j, k))
	if max_area[temp] != None:
		return max_area[temp]
	x1 = x2 = x3 = 0
	if i >= 0 and j >= 0:
		x1 = get_max_area(i - 1, j - 1, k) + r[i] * g[j]
	if i >= 0 and k >= 0:
		x2 = get_max_area(i - 1, j, k - 1) + r[i] * b[k]
	if j >= 0 and k >= 0:
		x3 = get_max_area(i, j - 1, k - 1) + g[j] * b[k]
	max_area[temp] = max(x1, x2, x3)
	return max_area[temp]
r.sort()
g.sort()
b.sort()
print(get_max_area(R - 1, G - 1, B - 1))


from collections import defaultdict as dd
import math
import sys
import heapq
import copy
input = sys.stdin.readline

def nn():
	return int(input())

def li():
	return list(input())

def mi():
	return map(int, input().split())

def lm():
	return list(map(int, input().split()))

def solve():
	(r, g, b) = mi()
	rs = lm()
	gs = lm()
	bs = lm()
	rs.sort()
	gs.sort()
	bs.sort()
	ans = [[[0 for i in range(b + 1)] for i in range(g + 1)] for i in range(r + 1)]
	for i in range(1, r + 1):
		for j in range(1, g + 1):
			ans[i][j][0] = ans[i - 1][j - 1][0] + rs[i - 1] * gs[j - 1]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(1, b + 1):
				new_len = bs[k - 1]
				if i == 0:
					i_len = 0
				else:
					i_len = ans[i - 1][j][k - 1] + rs[i - 1] * new_len
				if j == 0:
					j_len = 0
				else:
					j_len = ans[i][j - 1][k - 1] + gs[j - 1] * new_len
				if i > 0 and j > 0:
					i_j_len = ans[i - 1][j - 1][k] + rs[i - 1] * gs[j - 1]
				else:
					i_j_len = 0
				ans[i][j][k] = max(i_len, j_len, ans[i][j][k - 1], i_j_len)
	print(ans[r][g][b])
solve()


import io
import os
import sys
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def prdbg(*args, **kwargs):
	print(*args, **kwargs)
	pass

def get_str():
	return input().decode().strip()

def rint():
	return map(int, input().split())

def oint():
	return int(input())

def valid(i1, i2, i3):
	if (i1 + i2 + i3) % 2 or (i1 < 0 or i2 < 0 or i3 < 0) or i3 > i1 + i2 or (i2 > i1 + i3) or (i1 > i2 + i3):
		return False
	return True

def dfs(i1, i2, i3):
	if not valid(i1, i2, i3):
		return -2
	if dp[i1][i2][i3] != -1:
		return dp[i1][i2][i3]
	ret1 = dfs(i1 - 1, i2 - 1, i3)
	if ret1 >= 0:
		ret1 += a1[i1] * a2[i2]
	ret2 = dfs(i1 - 1, i2, i3 - 1)
	if ret2 >= 0:
		ret2 += a1[i1] * a3[i3]
	ret3 = dfs(i1, i2 - 1, i3 - 1)
	if ret3 >= 0:
		ret3 += a2[i2] * a3[i3]
	ret = max(ret1, ret2, ret3)
	dp[i1][i2][i3] = ret
	return ret
(n1, n2, n3) = rint()
(a1, a2, a3) = (list(rint()), list(rint()), list(rint()))
a1.sort(reverse=True)
a2.sort(reverse=True)
a3.sort(reverse=True)
a1 = [0] + a1
a2 = [0] + a2
a3 = [0] + a3
n1 += 1
n2 += 1
n3 += 1
dp = [[[-1 for i3 in range(n3)] for i2 in range(n2)] for i1 in range(n1)]
dp[1][1][0] = a1[1] * a2[1]
dp[1][0][1] = a1[1] * a3[1]
dp[0][1][1] = a2[1] * a3[1]
dp[0][0][0] = -2
for i1 in range(n1):
	for i2 in range(n2):
		for i3 in range(n3):
			dfs(i1, i2, i3)
ans = -1
for i1 in range(n1):
	for i2 in range(n2):
		for i3 in range(n3):
			ans = max(ans, dp[i1][i2][i3])
print(ans)


import sys, io, os, time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect, math, heapq
alphabet = 'abcdefghijklmnopqrstuvwxyz'
input = sys.stdin.readline

def solve():
	(r, g, b) = map(int, input().split())
	(R, G, B) = (sorted(list(map(int, input().split()))), sorted(list(map(int, input().split()))), sorted(list(map(int, input().split()))))
	dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i + j + k < 2:
					continue
				if i > 0 and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1])
				if i > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i - 1] * B[k - 1])
				if j > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
	return dp[r][g][b]
print(solve())


(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
memo = [[[-1] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]

def calc(ir, ig, ib):
	if memo[ir][ig][ib] != -1:
		return memo[ir][ig][ib]
	ans = 0
	if ir < r and ig < g:
		ans = max(ans, calc(ir + 1, ig + 1, ib) + R[ir] * G[ig])
	if ir < r and ib < b:
		ans = max(ans, calc(ir + 1, ig, ib + 1) + R[ir] * B[ib])
	if ig < g and ib < b:
		ans = max(ans, calc(ir, ig + 1, ib + 1) + G[ig] * B[ib])
	memo[ir][ig][ib] = ans
	return ans
print(calc(0, 0, 0))


import os, sys
from io import IOBase, BytesIO
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import sys

class ostream:

	def __lshift__(self, a):
		sys.stdout.write(str(a))
		return self
cout = ostream()
endl = '\n'

def get_input(a=str):
	return a(input())

def get_int_input():
	return get_input(int)

def get_input_arr(a):
	return list(map(a, input().split()))

def get_int_input_arr():
	return get_input_arr(int)

def solve():
	(n, m, k) = get_int_input_arr()
	arr1 = get_int_input_arr()
	arr2 = get_int_input_arr()
	arr3 = get_int_input_arr()
	(n1, n2, n3) = (n, m, k)
	arr1.sort(reverse=True)
	arr2.sort(reverse=True)
	arr3.sort(reverse=True)
	res = 0
	dp = [[[0] * (n3 + 1) for _ in range(n2 + 1)] for _ in range(n1 + 1)]
	res = -float('inf')
	for b in range(n3 + 1):
		for g in range(n2 + 1):
			for r in range(n1 + 1):
				dp[r][g][b] = max(dp[r - 1][g][b - 1] + arr1[r - 1] * arr3[b - 1] if r > 0 and b > 0 else 0, dp[r - 1][g - 1][b] + arr1[r - 1] * arr2[g - 1] if r > 0 and g > 0 else 0, dp[r][g - 1][b - 1] + arr2[g - 1] * arr3[b - 1] if g > 0 and b > 0 else 0)
				res = max(res, dp[r][g][b])
	cout << res << endl

def main():
	solve()
main()


import sys
input = sys.stdin.readline
import heapq
(R, G, B) = map(int, input().split())
r = [int(item) for item in input().split()]
g = [int(item) for item in input().split()]
b = [int(item) for item in input().split()]
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
nr = len(r)
ng = len(g)
nb = len(b)
dp = [[[0] * (nb + 1) for _ in range(ng + 1)] for _ in range(nr + 1)]
ans = 0
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			if (i + j + k) % 2 == 1:
				continue
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + b[k - 1] * r[i - 1])
			ans = max(ans, dp[i][j][k])
print(ans)


(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
for j in range(g - 1, -1, -1):
	for k in range(b - 1, -1, -1):
		dp[r][j][k] = G[j] * B[k] + dp[r][j + 1][k + 1]
for i in range(r - 1, -1, -1):
	for k in range(b - 1, -1, -1):
		dp[i][g][k] = R[i] * B[k] + dp[i + 1][g][k + 1]
for i in range(r - 1, -1, -1):
	for j in range(g - 1, -1, -1):
		dp[i][j][b] = R[i] * G[j] + dp[i + 1][j + 1][b]
for i in range(r - 1, -1, -1):
	for j in range(g - 1, -1, -1):
		for k in range(b - 1, -1, -1):
			case1 = dp[i + 1][j][k]
			case2 = dp[i][j + 1][k]
			case3 = dp[i][j][k + 1]
			case4 = R[i] * G[j] + dp[i + 1][j + 1][k]
			case5 = R[i] * B[k] + dp[i + 1][j][k + 1]
			case6 = G[j] * B[k] + dp[i][j + 1][k + 1]
			dp[i][j][k] = max(case1, case2, case3, case4, case5, case6)
print(dp[0][0][0])


(a, b, c) = list(map(int, input().split()))
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
dp = [[[0 for i in range(201)] for j in range(201)] for k in range(201)]
ans = 0
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
for i in range(len(R) + 1):
	for j in range(len(G) + 1):
		for k in range(len(B) + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1])
			if j and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
			if i and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i - 1] * B[k - 1])
			ans = max(ans, dp[i][j][k])
print(ans)


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def print_list(l):
	print(' '.join(map(str, l)))
from collections import deque as dq
(R, G, B) = RL()
r = RLL()
g = RLL()
b = RLL()
r.sort()
g.sort()
b.sort()
dp = [[[0] * (B + 1) for _ in range(G + 1)] for _ in range(R + 1)]
for i in range(R, -1, -1):
	for j in range(G, -1, -1):
		for k in range(B, -1, -1):
			if R - i + G - j + B - k & 1:
				continue
			tmp = 0
			if i < R and j < G:
				tmp = max(dp[i + 1][j + 1][k] + r[i] * g[j], tmp)
			if i < R and k < B:
				tmp = max(dp[i + 1][j][k + 1] + r[i] * b[k], tmp)
			if j < G and k < B:
				tmp = max(dp[i][j + 1][k + 1] + g[j] * b[k], tmp)
			if tmp > 0:
				dp[i][j][k] = tmp
print(max((a for c in dp for b in c for a in b)))


import sys as _sys
_sys.setrecursionlimit(2 ** 14)
_cache = dict()

class _SortedSeqs:

	def __init__(self, seqs):
		self.seqs = tuple((tuple(sorted(seq)) for seq in seqs))

	def __hash__(self):
		return id(self)

def compute_max_area(r_seq, g_seq, b_seq):
	sorted_seqs_obj = _SortedSeqs((r_seq, g_seq, b_seq))
	seqs_sizes = tuple(map(len, sorted_seqs_obj.seqs))
	return _compute_max_area(sorted_seqs_obj, seqs_sizes)

def _compute_max_area(sorted_seqs_obj, seqs_sizes):
	cache_key = (sorted_seqs_obj, seqs_sizes)
	if cache_key in _cache.keys():
		return _cache[cache_key]
	seqs = sorted_seqs_obj.seqs
	nonempty_seqs_n = _how_many_nonempty(seqs_sizes)
	if nonempty_seqs_n < 2:
		ab_seqs_indices_list = []
	elif nonempty_seqs_n == 2:
		ab_seqs_indices = [i for (i, seq_size) in enumerate(seqs_sizes) if seq_size > 0]
		ab_seqs_indices_list = [ab_seqs_indices]
	else:
		assert nonempty_seqs_n == 3
		seqs_indices_sorted_by_size = [i for (i, seq) in sorted(enumerate(seqs), key=lambda pair: (pair[1][seqs_sizes[pair[0]] - 1], seqs_sizes[pair[0]]))]
		ab_seqs_indices_1 = (seqs_indices_sorted_by_size[2], seqs_indices_sorted_by_size[0])
		ab_seqs_indices_2 = (seqs_indices_sorted_by_size[2], seqs_indices_sorted_by_size[1])
		ab_seqs_indices_list = [ab_seqs_indices_1, ab_seqs_indices_2]
	max_areas_variants = []
	for (a_seq_index, b_seq_index) in ab_seqs_indices_list:
		a_seq_last = seqs[a_seq_index][seqs_sizes[a_seq_index] - 1]
		b_seq_last = seqs[b_seq_index][seqs_sizes[b_seq_index] - 1]
		new_seqs_sizes = list(seqs_sizes)
		new_seqs_sizes[a_seq_index] -= 1
		new_seqs_sizes[b_seq_index] -= 1
		max_area = _compute_max_area(sorted_seqs_obj, tuple(new_seqs_sizes))
		max_area += a_seq_last * b_seq_last
		max_areas_variants.append(max_area)
	max_area = max(max_areas_variants, default=0)
	_cache[cache_key] = max_area
	return max_area

def _how_many_nonempty(seqs_sizes):
	return len([size for size in seqs_sizes if size > 0])

def main():
	(r_n, g_n, b_n) = map(int, input().split())
	r_seq = tuple(map(int, input().split()))
	g_seq = tuple(map(int, input().split()))
	b_seq = tuple(map(int, input().split()))
	result = compute_max_area(r_seq, g_seq, b_seq)
	print(result)
main()


(r, g, b) = list(map(int, input().split()))
ls_r = sorted(list(map(int, input().split())))
ls_g = sorted(list(map(int, input().split())))
ls_b = sorted(list(map(int, input().split())))
dp = [[[-1 for _ in range(b + 1)] for _ in range(g + 1)] for _ in range(r + 1)]

def recursive(idx_r, idx_g, idx_b):
	if dp[idx_r][idx_g][idx_b] != -1:
		return dp[idx_r][idx_g][idx_b]
	res_1 = 0
	res_2 = 0
	res_3 = 0
	if idx_r - 1 >= 0 and idx_g - 1 >= 0:
		res_1 = recursive(idx_r - 1, idx_g - 1, idx_b) + ls_r[idx_r - 1] * ls_g[idx_g - 1]
	if idx_g - 1 >= 0 and idx_b - 1 >= 0:
		res_2 = recursive(idx_r, idx_g - 1, idx_b - 1) + ls_g[idx_g - 1] * ls_b[idx_b - 1]
	if idx_r - 1 >= 0 and idx_b - 1 >= 0:
		res_3 = recursive(idx_r - 1, idx_g, idx_b - 1) + ls_r[idx_r - 1] * ls_b[idx_b - 1]
	dp[idx_r][idx_g][idx_b] = max(res_1, res_2, res_3)
	return dp[idx_r][idx_g][idx_b]
print(recursive(r, g, b))


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default='z', func=lambda a, b: min(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] < key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
(n, g, b) = map(int, input().split())
nr = list(map(int, input().split()))
nb = list(map(int, input().split()))
ng = list(map(int, input().split()))
nr.sort(reverse=True)
nb.sort(reverse=True)
ng.sort(reverse=True)
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(n + 1)]
m = 0
for i in range(n + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i - 1][j - 1][k] + nr[i - 1] * nb[j - 1], dp[i][j][k])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i - 1][j][k - 1] + nr[i - 1] * ng[k - 1], dp[i][j][k])
			if k > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j - 1][k - 1] + nb[j - 1] * ng[k - 1], dp[i][j][k])
			m = max(m, dp[i][j][k])
print(m)


(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = [[[-1] * (B + 1) for i in range(G + 1)] for j in range(R + 1)]

def calc(nr, ng, nb):
	if dp[nr][ng][nb] != -1:
		return dp[nr][ng][nb]
	res = 0
	if nr < R and ng < G:
		res = max(res, calc(nr + 1, ng + 1, nb) + r[nr] * g[ng])
	if nr < R and nb < B:
		res = max(res, calc(nr + 1, ng, nb + 1) + r[nr] * b[nb])
	if ng < G and nb < B:
		res = max(res, calc(nr, ng + 1, nb + 1) + g[ng] * b[nb])
	dp[nr][ng][nb] = res
	return res
print(calc(0, 0, 0))


from sys import stdin, stdout
final_ans = 0
(R, G, B) = map(int, stdin.readline().strip().split(' '))
Ra = sorted(list(map(int, stdin.readline().strip().split(' '))), reverse=True)
Ga = sorted(list(map(int, stdin.readline().strip().split(' '))), reverse=True)
Ba = sorted(list(map(int, stdin.readline().strip().split(' '))), reverse=True)
dparr = [[[-1 for i in range(B + 1)] for j in range(G + 1)] for k in range(R + 1)]
dparr[1][1][0] = Ra[0] * Ga[0]
dparr[1][0][1] = Ra[0] * Ba[0]
dparr[0][1][1] = Ga[0] * Ba[0]
final_ans = max(final_ans, dparr[1][1][0], dparr[1][0][1], dparr[0][1][1])

def add_ns(t1):
	global queue, Ra, Ga, Ba, dparr
	(x, y, z) = t1
	if x + 1 <= R:
		if y + 1 <= G:
			if dparr[x + 1][y + 1][z] == -1:
				queue.append((x + 1, y + 1, z))
				dparr[x + 1][y + 1][z] = 0
		if z + 1 <= B:
			if dparr[x + 1][y][z + 1] == -1:
				queue.append((x + 1, y, z + 1))
				dparr[x + 1][y][z + 1] = 0
	if y + 1 <= G and z + 1 <= B:
		if dparr[x][y + 1][z + 1] == -1:
			queue.append((x, y + 1, z + 1))
			dparr[x][y + 1][z + 1] = 0

def store_ans(t1):
	global final_ans, dparr, Ra, Ga, Ba
	(x, y, z) = t1
	if dparr[x - 1][y - 1][z] != -1 and min(x - 1, y - 1, z) >= 0:
		dparr[x][y][z] = max(dparr[x][y][z], dparr[x - 1][y - 1][z] + Ra[x - 1] * Ga[y - 1])
	if dparr[x - 1][y][z - 1] != -1 and min(x - 1, y, z - 1) >= 0:
		dparr[x][y][z] = max(dparr[x][y][z], dparr[x - 1][y][z - 1] + Ra[x - 1] * Ba[z - 1])
	if dparr[x][y - 1][z - 1] != -1 and min(x, y - 1, z - 1) >= 0:
		dparr[x][y][z] = max(dparr[x][y][z], dparr[x][y - 1][z - 1] + Ga[y - 1] * Ba[z - 1])
	final_ans = max(final_ans, dparr[x][y][z])
queue = [(1, 1, 0), (1, 0, 1), (0, 1, 1)]
add_ns(queue[0])
add_ns(queue[1])
add_ns(queue[2])
ptr = 3
while ptr < len(queue):
	store_ans(queue[ptr])
	add_ns(queue[ptr])
	ptr += 1
stdout.write(str(final_ans) + '\n')


import sys
input = sys.stdin.readline
(R, G, B) = map(int, input().split())
RR = sorted(map(int, input().split()), reverse=True)
GG = sorted(map(int, input().split()), reverse=True)
BB = sorted(map(int, input().split()), reverse=True)
DPLIST = [[[-1] * (B + 1) for i in range(G + 1)] for j in range(R + 1)]

def calc(ir, ig, ib):
	if DPLIST[ir][ig][ib] != -1:
		return DPLIST[ir][ig][ib]
	ANS = 0
	if ir < R and ig < G:
		ANS = max(ANS, RR[ir] * GG[ig] + calc(ir + 1, ig + 1, ib))
	if ig < G and ib < B:
		ANS = max(ANS, GG[ig] * BB[ib] + calc(ir, ig + 1, ib + 1))
	if ir < R and ib < B:
		ANS = max(ANS, RR[ir] * BB[ib] + calc(ir + 1, ig, ib + 1))
	DPLIST[ir][ig][ib] = ANS
	return ANS
print(calc(0, 0, 0))


import sys
sys.setrecursionlimit(10 ** 5)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def MI():
	return map(int, sys.stdin.readline().split())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline()[:-1]
(rn, gn, bn) = MI()
rr = LI()
gg = LI()
bb = LI()
rr.sort(reverse=True)
gg.sort(reverse=True)
bb.sort(reverse=True)
dp = [[[-1] * (bn + 1) for _ in range(gn + 1)] for _ in range(rn + 1)]
dp[0][0][0] = 0
ans = 0
for i in range(rn + 1):
	for j in range(gn + 1):
		for k in range(bn + 1):
			pre = dp[i][j][k]
			if pre == -1:
				continue
			ans = max(ans, pre)
			if i < rn and j < gn:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], pre + rr[i] * gg[j])
			if i < rn and k < bn:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], pre + rr[i] * bb[k])
			if j < gn and k < bn:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], pre + gg[j] * bb[k])
print(ans)


def solve():
	(r, g, b) = map(int, input().split())
	R = list(map(int, input().split()))
	G = list(map(int, input().split()))
	B = list(map(int, input().split()))
	R.sort()
	G.sort()
	B.sort()
	dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i + j + k < 2:
					continue
				if i > 0 and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1])
				if i > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i - 1] * B[k - 1])
				if j > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
	ans = dp[r][g][b]
	return ans
print(solve())


from collections import defaultdict
from sys import setrecursionlimit, stdin
input = stdin.readline
setrecursionlimit(100000)

def dfs(r, g, b, rr, gg, bb):
	if r == 0 and b == 0 or (r == 0 and g == 0) or (g == 0 and b == 0):
		return 0
	x = 0
	y = 0
	z = 0
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	if r != 0 and g != 0:
		x = rr[r - 1] * gg[g - 1] + dfs(r - 1, g - 1, b, rr, gg, bb)
	if r != 0 and b != 0:
		y = rr[r - 1] * bb[b - 1] + dfs(r - 1, g, b - 1, rr, gg, bb)
	if b != 0 and g != 0:
		z = bb[b - 1] * gg[g - 1] + dfs(r, g - 1, b - 1, rr, gg, bb)
	dp[r][g][b] = max(x, y, z)
	return max(x, y, z)
(r, g, b) = map(int, input().split())
rr = list(map(int, input().split()))
gg = list(map(int, input().split()))
bb = list(map(int, input().split()))
rr.sort()
gg.sort()
bb.sort()
dp = [[[-1] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]
print(dfs(r, g, b, rr, gg, bb))


from sys import stdin
import time
(r, g, b) = map(int, stdin.readline().split())
red = list(map(int, stdin.readline().split()))
green = list(map(int, stdin.readline().split()))
blue = list(map(int, stdin.readline().split()))
red.sort()
green.sort()
blue.sort()
dp = [[[0 for _ in range(b + 1)] for _ in range(g + 1)] for _ in range(r + 1)]
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + red[i - 1] * green[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + red[i - 1] * blue[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + green[j - 1] * blue[k - 1])
print(dp[-1][-1][-1])


(r, g, b) = map(int, input().split())
l1 = list(map(int, input().split()))
l2 = list(map(int, input().split()))
l3 = list(map(int, input().split()))
l1.sort(reverse=True)
l2.sort(reverse=True)
l3.sort(reverse=True)
dp = [[[0 for i in range(201)] for j in range(201)] for k in range(201)]
ans = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + l1[i - 1] * l2[j - 1])
			if j and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + l2[j - 1] * l3[k - 1])
			if i and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + l1[i - 1] * l3[k - 1])
			ans = max(ans, dp[i][j][k])
print(ans)


(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
area = 0
r.sort(reverse=True)
b.sort(reverse=True)
g.sort(reverse=True)
L = max(len(r), len(g), len(b))
dp = [[[0] * (B + 1) for i in range(G + 1)] for j in range(R + 1)]
tr = 0
tg = 0
tb = 0
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			area = max(area, dp[i][j][k])
print(area)


import sys
import math
from math import *
from collections import Counter, defaultdict
from io import BytesIO, IOBase
from collections import deque

def rec(i, j, k):
	if i == rl and j == bl or (i == rl and k == gl) or (k == gl and j == bl):
		return 0
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	else:
		x = r[i] * b[j]
		y = b[j] * g[k]
		z = r[i] * g[k]
		if x > 0:
			x += rec(i + 1, j + 1, k)
		if y > 0:
			y += rec(i, j + 1, k + 1)
		if z > 0:
			z += rec(i + 1, j, k + 1)
		dp[i][j][k] = max(x, y, z)
		return dp[i][j][k]

def main():
	global r, g, b, rl, bl, gl, dp
	(rl, bl, gl) = list(map(int, input().split()))
	r = list(map(int, input().split())) + [0]
	b = list(map(int, input().split())) + [0]
	g = list(map(int, input().split())) + [0]
	cnt = 3
	i = j = k = 0
	ans = 0
	dp = [[[-1 for i in range(gl + 1)] for j in range(bl + 1)] for k in range(rl + 1)]
	r.sort(reverse=True)
	b.sort(reverse=True)
	g.sort(reverse=True)
	print(rec(i, j, k))
main()


import sys
input = sys.stdin.readline
(r, g, b) = [int(_) for _ in input().split()]
R = [int(_) for _ in input().split()]
G = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]
R = sorted(R, reverse=True)
G = sorted(G, reverse=True)
B = sorted(B, reverse=True)
dp = []
for i in range(r + 1):
	sdp = [[0] * (b + 1) for _ in range(g + 1)]
	dp.append(sdp)
answer = 0
for nb_taken in range(r + g + b):
	if nb_taken % 2:
		continue
	for i in range(nb_taken + 1):
		if i > r:
			break
		for j in range(nb_taken - i - b, nb_taken - i + 1):
			if j > g:
				break
			k = nb_taken - i - j
			if k > b:
				continue
			if i + j < k or i + k < j or j + k < i:
				continue
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + R[i] * G[j])
				answer = max(answer, dp[i + 1][j + 1][k])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + R[i] * B[k])
				answer = max(answer, dp[i + 1][j][k + 1])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + G[j] * B[k])
				answer = max(answer, dp[i][j + 1][k + 1])
print(answer)


import sys
input = sys.stdin.readline
(a, b, c) = 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)
p = [[[0 for i in range(c + 4)] for s in range(b + 4)] for x in range(a + 4)]
ans = 0
for i in range(0, a + b + c + 2, 2):
	for x in range(i + 1):
		for y in range(i + 1 - x):
			z = i - x - y
			if x < a and y < b and (z < c + 1):
				p[x + 1][y + 1][z] = max(p[x + 1][y + 1][z], p[x][y][z] + A[x] * B[y])
			if x < a and y < b + 1 and (z < c):
				p[x + 1][y][z + 1] = max(p[x + 1][y][z + 1], p[x][y][z] + A[x] * C[z])
			if x < a + 1 and y < b and (z < c):
				p[x][y + 1][z + 1] = max(p[x][y + 1][z + 1], p[x][y][z] + B[y] * C[z])
for x in p:
	for y in x:
		for z in y:
			ans = max(z, ans)
print(ans)


(r, g, b) = map(int, input().split())
red = [0] + sorted(map(int, input().split()))
green = [0] + sorted(map(int, input().split()))
blue = [0] + sorted(map(int, input().split()))
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + red[i] * green[j])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + red[i] * blue[k])
			if k > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + blue[k] * green[j])
print(dp[r][g][b])


import sys
input = sys.stdin.readline
(a, b, c) = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
z = list(map(int, input().split()))
x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)
a += 1
b += 1
c += 1
x = [0] + x
y = [0] + y
z = [0] + z
tmp = [[0] * c for _ in range(b)]
best = [tmp for _ in range(a)]
ans = 0
for i in range(a):
	for j in range(b):
		for k in range(c):
			if (i + j + k) % 2 == 0:
				(aa, bb, cc) = (0, 0, 0)
				if i > 0 and j > 0:
					aa = best[i - 1][j - 1][k] + x[i] * y[j]
				if i > 0 and k > 0:
					bb = best[i - 1][j][k - 1] + x[i] * z[k]
				if j > 0 and k > 0:
					cc = best[i][j - 1][k - 1] + y[j] * z[k]
				best[i][j][k] = max(aa, bb, cc)
				ans = max(ans, best[i][j][k])
print(ans)


(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = [[[0 for ___ in range(B + 1)] for __ in range(G + 1)] for _ in range(R + 1)]
mx = 0
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i < R and j < G:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
			if i < R and k < B:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + r[i] * b[k])
			if j < G and k < B:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
			mx = max(mx, dp[i][j][k])
print(mx)


import sys
input = sys.stdin.readline
from copy import deepcopy
(a, b, c) = map(int, input().split())
X = list(map(int, input().split()))
X.sort()
X = X[::-1]
Y = list(map(int, input().split()))
Y.sort()
Y = Y[::-1]
Z = list(map(int, input().split()))
Z.sort()
Z = Z[::-1]
dp = [[[0] * (c + 1) for _ in range(b + 1)] for _ in range(a + 1)]
for i in range(a + 1):
	for j in range(b + 1):
		for k in range(c + 1):
			if i * j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + X[i - 1] * Y[j - 1])
			if j * k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + Y[j - 1] * Z[k - 1])
			if i * k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + X[i - 1] * Z[k - 1])
R = 0
for i in range(a + 1):
	for j in range(b + 1):
		for k in range(c + 1):
			R = max(R, dp[i][j][k])
print(R)


(ri, gi, bi) = map(int, input().split())
rr = sorted(list(map(int, input().split())))
gr = sorted(list(map(int, input().split())))
br = sorted(list(map(int, input().split())))
dp = [[[-1] * (bi + 1) for i in range(gi + 1)] for j in range(ri + 1)]

def area(r, g, b):
	if dp[r + 1][g + 1][b + 1] != -1:
		return dp[r + 1][g + 1][b + 1]
	ans = 0
	if r >= 0 and g >= 0:
		ans = max(ans, rr[r] * gr[g] + area(r - 1, g - 1, b))
	if r >= 0 and b >= 0:
		ans = max(ans, rr[r] * br[b] + area(r - 1, g, b - 1))
	if b >= 0 and g >= 0:
		ans = max(ans, br[b] * gr[g] + area(r, g - 1, b - 1))
	dp[r + 1][g + 1][b + 1] = ans
	return ans
print(area(ri - 1, gi - 1, bi - 1))


import sys
from array import array
import typing as Tp

def input():
	return sys.stdin.buffer.readline().decode('utf-8')

def output(*args):
	sys.stdout.buffer.write(('\n'.join(map(str, args)) + '\n').encode('utf-8'))

def main():
	(R, G, B) = map(int, input().split())
	r_sticks = sorted(map(float, input().split()), reverse=True) + [0.0]
	g_sticks = sorted(map(float, input().split()), reverse=True) + [0.0]
	b_sticks = sorted(map(float, input().split()), reverse=True) + [0.0]
	dp = [[[0.0] * (B + 2) for _ in range(G + 2)] for _ in range(R + 2)]
	for ri in range(R + 1):
		for gi in range(G + 1):
			for bi in range(B + 1):
				dp[ri + 1][gi + 1][bi] = max(dp[ri + 1][gi + 1][bi], dp[ri][gi][bi] + r_sticks[ri] * g_sticks[gi])
				dp[ri + 1][gi][bi + 1] = max(dp[ri + 1][gi][bi + 1], dp[ri][gi][bi] + r_sticks[ri] * b_sticks[bi])
				dp[ri][gi + 1][bi + 1] = max(dp[ri][gi + 1][bi + 1], dp[ri][gi][bi] + g_sticks[gi] * b_sticks[bi])
	ans = max((max((max((dp[r][g][b] for b in range(B + 1))) for g in range(G + 1))) for r in range(R + 1)))
	print(int(ans + 1e-06))
main()


import sys
input = sys.stdin.readline
(rr, gg, bb) = map(int, input().split())
inf = 114514
r = list(map(int, input().split())) + [inf]
g = list(map(int, input().split())) + [inf]
b = list(map(int, input().split())) + [inf]
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = []
for _ in range(rr + 1):
	dp.append([[0] * (bb + 1) for _ in range(gg + 1)])
ans = 0
for i in range(rr + 1):
	ri = r[i]
	for j in range(gg + 1):
		gj = g[j]
		for k in range(bb + 1):
			bk = b[k]
			if (i + j + k) % 2:
				continue
			dpijk = 0
			if i > 0 and j > 0:
				dpijk = max(dp[i - 1][j - 1][k] + ri * gj, dpijk)
			if j > 0 and k > 0:
				dpijk = max(dp[i][j - 1][k - 1] + gj * bk, dpijk)
			if k > 0 and i > 0:
				dpijk = max(dp[i - 1][j][k - 1] + bk * ri, dpijk)
			dp[i][j][k] = dpijk
			if ans < dpijk:
				ans = dpijk
print(ans)


import sys
input = sys.stdin.readline
MAXN = 202

def main():
	(R, G, B) = list(map(int, input().split()))
	r = list(map(int, input().split()))
	g = list(map(int, input().split()))
	b = list(map(int, input().split()))
	r.sort()
	g.sort()
	b.sort()
	dp = [[[0] * MAXN for _ in range(MAXN)] for _ in range(MAXN)]
	for i in range(1, R + 1):
		for j in range(1, G + 1):
			dp[i][j][0] = r[i - 1] * g[j - 1] + dp[i - 1][j - 1][0]
	for i in range(1, R + 1):
		for k in range(1, B + 1):
			dp[i][0][k] = r[i - 1] * b[k - 1] + dp[i - 1][0][k - 1]
	for j in range(1, G + 1):
		for k in range(1, B + 1):
			dp[0][j][k] = g[j - 1] * b[k - 1] + dp[0][j - 1][k - 1]
	for i in range(1, R + 1):
		for j in range(1, G + 1):
			for k in range(1, B + 1):
				dp[i][j][k] = max(r[i - 1] * g[j - 1] + dp[i - 1][j - 1][k], r[i - 1] * b[k - 1] + dp[i - 1][j][k - 1], g[j - 1] * b[k - 1] + dp[i][j - 1][k - 1])
	print(dp[R][G][B])
main()


(r, g, b) = map(int, input().split())
rr = sorted(list(map(int, input().split())))
gg = sorted(list(map(int, input().split())))
bb = sorted(list(map(int, input().split())))
rr = rr[::-1]
bb = bb[::-1]
gg = gg[::-1]
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
maxi = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i][j][k] + rr[i] * gg[j], dp[i + 1][j + 1][k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j][k] + gg[j] * bb[k], dp[i][j + 1][k + 1])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i][j][k] + rr[i] * bb[k], dp[i + 1][j][k + 1])
			maxi = max(maxi, dp[i][j][k])
print(maxi)


import sys, bisect, string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from collections import deque, defaultdict, Counter
from itertools import permutations, combinations, groupby
rep = range
R = range

def Golf():
	(n, *t) = map(int, open(0).read().split())

def I():
	return int(input())

def S_():
	return input()

def IS():
	return input().split()

def LS():
	return [i for i in input().split()]

def MI():
	return map(int, input().split())

def LI():
	return [int(i) for i in input().split()]

def LI_():
	return [int(i) - 1 for i in input().split()]

def NI(n):
	return [int(input()) for i in range(n)]

def NI_(n):
	return [int(input()) - 1 for i in range(n)]

def StoLI():
	return [ord(i) - 97 for i in input()]

def ItoS(n):
	return chr(n + 97)

def LtoS(ls):
	return ''.join([chr(i + 97) for i in ls])

def RA():
	return map(int, open(0).read().split())

def RLI(n=8, a=1, b=10):
	return [random.randint(a, b) for i in range(n)]

def RI(a=1, b=10):
	return random.randint(a, b)

def Rtest(T):
	(case, err) = (0, 0)
	for i in range(T):
		inp = INP()
		(a1, ls) = naive(*inp)
		a2 = solve(*inp)
		if a1 != a2:
			print((a1, a2), inp)
			err += 1
		case += 1
	print('Tested', case, 'case with', err, 'errors')

def GI(V, E, ls=None, Directed=False, index=1):
	org_inp = []
	g = [[] for i in range(V)]
	FromStdin = True if ls == None else False
	for i in range(E):
		if FromStdin:
			inp = LI()
			org_inp.append(inp)
		else:
			inp = ls[i]
		if len(inp) == 2:
			(a, b) = inp
			c = 1
		else:
			(a, b, c) = inp
		if index == 1:
			a -= 1
			b -= 1
		aa = (a, c)
		bb = (b, c)
		g[a].append(bb)
		if not Directed:
			g[b].append(aa)
	return (g, org_inp)

def GGI(h, w, search=None, replacement_of_found='.', mp_def={'#': 1, '.': 0}, boundary=1):
	mp = [boundary] * (w + 2)
	found = {}
	for i in R(h):
		s = input()
		for char in search:
			if char in s:
				found[char] = (i + 1) * (w + 2) + s.index(char) + 1
				mp_def[char] = mp_def[replacement_of_found]
		mp += [boundary] + [mp_def[j] for j in s] + [boundary]
	mp += [boundary] * (w + 2)
	return (h + 2, w + 2, mp, found)

def TI(n):
	return GI(n, n - 1)

def accum(ls):
	rt = [0]
	for i in ls:
		rt += [rt[-1] + i]
	return rt

def bit_combination(n, base=2):
	rt = []
	for tb in R(base ** n):
		s = [tb // base ** bt % base for bt in R(n)]
		rt += [s]
	return rt

def gcd(x, y):
	if y == 0:
		return x
	if x % y == 0:
		return y
	while x % y != 0:
		(x, y) = (y, x % y)
	return y

def YN(x):
	print(['NO', 'YES'][x])

def Yn(x):
	print(['No', 'Yes'][x])

def show(*inp, end='\n'):
	if show_flg:
		print(*inp, end=end)
mo = 10 ** 9 + 7
inf = float('inf')
FourNb = [(-1, 0), (1, 0), (0, 1), (0, -1)]
EightNb = [(-1, 0), (1, 0), (0, 1), (0, -1), (1, 1), (-1, -1), (1, -1), (-1, 1)]
compas = dict(zip('WENS', FourNb))
cursol = dict(zip('LRUD', FourNb))
l_alp = string.ascii_lowercase
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
input = lambda : sys.stdin.readline().rstrip()
show_flg = False
show_flg = True
ans = 0
(x, y, z) = LI()
R = sorted(LI())[::-1]
G = sorted(LI())[::-1]
B = sorted(LI())[::-1]
dp = [[[0] * (z + 1) for j in range(y + 1)] for i in range(x + 1)]
n = x + y + z
for t in range(0, n + 1, 2):
	for i in range(x + 1):
		for j in range(y + 1):
			k = t - i - j
			if 0 <= k <= z:
				if i + 1 <= x and j + 1 <= y:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + R[i] * G[j])
				if i + 1 <= x and k + 1 <= z:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + R[i] * B[k])
				if j + 1 <= y and k + 1 <= z:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + G[j] * B[k])
ans = max([dp[i][y][z] for i in range(x + 1)])
ans = max(max([dp[x][i][z] for i in range(y + 1)]), ans)
ans = max(max([dp[x][y][i] for i in range(z + 1)]), ans)
print(ans)


(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
R.sort()
G.sort()
B.sort()
dp = [[[0] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]
for rr in range(r + 1):
	for gg in range(g + 1):
		for bb in range(b + 1):
			if (rr == 0) + (gg == 0) + (bb == 0) >= 2:
				continue
			if rr == 0:
				dp[rr][gg][bb] = dp[rr][gg - 1][bb - 1] + G[gg - 1] * B[bb - 1]
			if gg == 0:
				dp[rr][gg][bb] = dp[rr - 1][gg][bb - 1] + R[rr - 1] * B[bb - 1]
			if bb == 0:
				dp[rr][gg][bb] = dp[rr - 1][gg - 1][bb] + G[gg - 1] * R[rr - 1]
			if rr * gg * bb > 0:
				x = dp[rr][gg - 1][bb - 1] + G[gg - 1] * B[bb - 1]
				y = dp[rr - 1][gg][bb - 1] + R[rr - 1] * B[bb - 1]
				z = dp[rr - 1][gg - 1][bb] + G[gg - 1] * R[rr - 1]
				dp[rr][gg][bb] = max(x, y, z)
print(dp[r][g][b])


(R, G, B) = list(map(int, input().split()))
r = sorted(list(map(int, input().split())), reverse=True)
g = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)

def f(x, y, z):
	m1 = 0
	m2 = 0
	m3 = 0
	if x < R and y < G:
		if dpt[x + 1][y + 1][z] == -1:
			dpt[x + 1][y + 1][z] = f(x + 1, y + 1, z)
		m1 = r[x] * g[y] + dpt[x + 1][y + 1][z]
	if y < G and z < B:
		if dpt[x][y + 1][z + 1] == -1:
			dpt[x][y + 1][z + 1] = f(x, y + 1, z + 1)
		m2 = g[y] * b[z] + dpt[x][y + 1][z + 1]
	if z < B and x < R:
		if dpt[x + 1][y][z + 1] == -1:
			dpt[x + 1][y][z + 1] = f(x + 1, y, z + 1)
		m3 = r[x] * b[z] + dpt[x + 1][y][z + 1]
	dpt[x][y][z] = max(m1, m2, m3)
	return dpt[x][y][z]
dpt = [[[-1 for _ in range(B + 1)] for _ in range(G + 1)] for _ in range(R + 1)]
print(f(0, 0, 0))


from sys import stdin, stdout
from math import gcd, sqrt, factorial, pi, inf
from collections import deque, defaultdict
from bisect import bisect, bisect_left
from time import time
from itertools import permutations as per
input = stdin.readline
R = lambda : map(int, input().split())
I = lambda : int(input())
S = lambda : input().rstrip('\r\n')
L = lambda : list(R())
P = lambda x: stdout.write(str(x) + '\n')
lcm = lambda x, y: x * y // gcd(x, y)
nCr = lambda x, y: f[x] * inv(f[y] * f[x - y] % N) % N
inv = lambda x: pow(x, N - 2, N)
sm = lambda x: (x ** 2 + x) // 2
N = 10 ** 9 + 7

def dp(x, y, z):
	if x == y == -1 or x == z == -1 or y == z == -1:
		return 0
	if a[x][y][z] != -1:
		return a[x][y][z]
	if x == -1:
		a[x][y][z] = g[y] * b[z] + dp(x, y - 1, z - 1)
		return a[x][y][z]
	elif y == -1:
		a[x][y][z] = r[x] * b[z] + dp(x - 1, y, z - 1)
		return a[x][y][z]
	elif z == -1:
		a[x][y][z] = r[x] * g[y] + dp(x - 1, y - 1, z)
		return a[x][y][z]
	else:
		a[x][y][z] = max(g[y] * b[z] + dp(x, y - 1, z - 1), r[x] * b[z] + dp(x - 1, y, z - 1), r[x] * g[y] + dp(x - 1, y - 1, z))
		return a[x][y][z]
a = [[[-1] * 201 for i in range(201)] for i in range(201)]
(x, y, z) = R()
r = sorted(R())
g = sorted(R())
b = sorted(R())
print(dp(x - 1, y - 1, z - 1))


def solve(i, j, k):
	if i < 0 and j < 0 or (j < 0 and k < 0) or (i < 0 and k < 0):
		return 0
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	ans = 0
	if i >= 0 and j >= 0:
		ans = max(ans, rs[i] * gs[j] + solve(i - 1, j - 1, k))
	if i >= 0 and k >= 0:
		ans = max(ans, rs[i] * bs[k] + solve(i - 1, j, k - 1))
	if j >= 0 and k >= 0:
		ans = max(ans, bs[k] * gs[j] + solve(i, j - 1, k - 1))
	dp[i][j][k] = ans
	return ans
(a, b, c) = map(int, input().split())
rs = sorted(list(map(int, input().split())))
gs = sorted(list(map(int, input().split())))
bs = sorted(list(map(int, input().split())))
dp = [[[-1 for x in range(c + 1)] for y in range(b + 1)] for z in range(a + 1)]
print(solve(a - 1, b - 1, c - 1))


import sys
input = sys.stdin.buffer.readline
(nr, ng, nb) = [int(x) for x in input().split()]
r = [int(x) for x in input().split()]
g = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]
r.sort()
g.sort()
b.sort()
memo = [[[-1 for _ in range(nb + 1)] for __ in range(ng + 1)] for ___ in range(nr + 1)]
memo[0][0][0] = 0
for i in range(nr):
	memo[i + 1][0][0] = 0
for j in range(ng):
	memo[0][j + 1][0] = 0
for k in range(nb):
	memo[0][0][k + 1] = 0

def dp(i, j, k):
	if i < -1 or j < -1 or k < -1:
		return -float('inf')
	if memo[i + 1][j + 1][k + 1] == -1:
		memo[i + 1][j + 1][k + 1] = max(dp(i, j - 1, k - 1) + g[j] * b[k], dp(i - 1, j - 1, k) + r[i] * g[j], dp(i - 1, j, k - 1) + r[i] * b[k])
	return memo[i + 1][j + 1][k + 1]
print(dp(nr - 1, ng - 1, nb - 1))


from sys import stdin, stdout, setrecursionlimit
from math import gcd, ceil, sqrt
from collections import Counter, deque
from bisect import bisect_left, bisect_right
ii1 = lambda : int(stdin.readline().strip())
is1 = lambda : stdin.readline().strip()
iia = lambda : list(map(int, stdin.readline().strip().split()))
isa = lambda : stdin.readline().strip().split()
setrecursionlimit(100000)
mod = 1000000007
(R, G, B) = iia()
(r, g, b) = (sorted(iia()), sorted(iia()), sorted(iia()))
dp = [[[0 for i in range(B + 1)] for j in range(G + 1)] for k in range(R + 1)]
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[-1][-1][-1])


import sys
import bisect
t = 1
for _ in range(t):
	(r, g, b) = map(int, input().split())
	l1 = list(map(int, input().split()))
	l2 = list(map(int, input().split()))
	l3 = list(map(int, input().split()))
	l1.sort(reverse=True)
	l2.sort(reverse=True)
	l3.sort(reverse=True)
	dp = [[[0 for k in range(b + 1)] for j in range(g + 1)] for i in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				(val1, val2, val3) = (0, 0, 0)
				if i - 1 >= 0 and j - 1 >= 0:
					val1 = l1[i - 1] * l2[j - 1]
				if j - 1 >= 0 and k - 1 >= 0:
					val2 = l2[j - 1] * l3[k - 1]
				if k - 1 >= 0 and i - 1 >= 0:
					val3 = l3[k - 1] * l1[i - 1]
				if val1 != 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + val1)
				if val2 != 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + val2)
				if val3 != 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + val3)
	maxi = 0
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				maxi = max(maxi, dp[i][j][k])
	print(maxi)


(lr, lg, lb) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort()
g.sort()
b.sort()
dp = [[[0 for i in range(lb + 1)] for j in range(lg + 1)] for k in range(lr + 1)]
for i in range(lr + 1):
	for j in range(lg + 1):
		for k in range(lb + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[lr][lg][lb])


from sys import stdin
from array import array

def recSolve(dp, r, g, b, rx, gx, bx, R, G, B):
	if rx == R:
		return sum((a * b for (a, b) in zip(g[gx:], b[bx:])))
	if gx == G:
		return sum((a * b for (a, b) in zip(r[rx:], b[bx:])))
	if bx == B:
		return sum((a * b for (a, b) in zip(g[gx:], r[rx:])))
	if dp[rx * G * B + gx * B + bx] != -1:
		return dp[rx * G * B + gx * B + bx]
	rg = recSolve(dp, r, g, b, rx + 1, gx + 1, bx, R, G, B) + r[rx] * g[gx]
	bg = recSolve(dp, r, g, b, rx, gx + 1, bx + 1, R, G, B) + b[bx] * g[gx]
	rb = recSolve(dp, r, g, b, rx + 1, gx, bx + 1, R, G, B) + r[rx] * b[bx]
	ans = max(rg, bg, rb)
	dp[rx * G * B + gx * B + bx] = ans
	return ans
input = stdin.readline
(R, G, B) = map(int, input().split())
r = sorted([*map(int, input().split())], reverse=True)
g = sorted([*map(int, input().split())], reverse=True)
b = sorted([*map(int, input().split())], reverse=True)
dp = array('q', (-1 for x in range(R * G * B)))
print(recSolve(dp, r, g, b, 0, 0, 0, R, G, B))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from collections import Counter
import heapq
from collections import Counter
from bisect import bisect_right
import bisect

def find(x, y, z):
	if dp[x][y][z] != -1:
		return dp[x][y][z]
	ans = 0
	if x < r and y < g:
		ans = max(ans, rl[x] * gl[y] + find(x + 1, y + 1, z))
	if x < r and z < b:
		ans = max(ans, rl[x] * bl[z] + find(x + 1, y, z + 1))
	if y < g and z < b:
		ans = max(ans, gl[y] * bl[z] + find(x, y + 1, z + 1))
	dp[x][y][z] = ans
	return ans
(r, g, b) = map(int, input().split())
rl = sorted(list(map(int, input().split())), reverse=True)
gl = sorted(list(map(int, input().split())), reverse=True)
bl = sorted(list(map(int, input().split())), reverse=True)
dp = [[[-1] * (b + 1) for i in range(g + 1)] for i in range(r + 1)]
print(find(0, 0, 0))


n = [int(x) for x in input().split()]
a = []
for i in range(3):
	a.append([int(x) for x in input().split()])
	a[i].sort(reverse=True)
dp = [[[0 for i in range(n[2] + 1)] for j in range(n[1] + 1)] for k in range(n[0] + 1)]
ans = 0
for i in range(n[0] + 1):
	for j in range(n[1] + 1):
		for k in range(n[2] + 1):
			if i < n[0] and j < n[1]:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[0][i] * a[1][j])
			if i < n[0] and k < n[2]:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[0][i] * a[2][k])
			if j < n[1] and k < n[2]:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + a[1][j] * a[2][k])
			ans = max(ans, dp[i][j][k])
print(ans)


(r, g, b) = [int(x) for x in input().split()]
a = [sorted([int(x) for x in input().split()], reverse=True) for _ in range(3)]
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
ans = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[0][i] * a[1][j])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[0][i] * a[2][k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + a[1][j] * a[2][k])
			ans = max(ans, dp[i][j][k])
print(ans)


def cal(r, g, b):
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	ans = 0
	if r < R and g < G:
		ans = max(ans, rl[r] * gl[g] + cal(r + 1, g + 1, b))
	if r < R and b < B:
		ans = max(ans, rl[r] * bl[b] + cal(r + 1, g, b + 1))
	if g < G and b < B:
		ans = max(ans, gl[g] * bl[b] + cal(r, g + 1, b + 1))
	dp[r][g][b] = ans
	return ans
(R, G, B) = map(int, input().split())
rl = list(map(int, input().split()))
gl = list(map(int, input().split()))
bl = list(map(int, input().split()))
rl.sort(reverse=True)
gl.sort(reverse=True)
bl.sort(reverse=True)
dp = []
for i in range(R + 1):
	l = []
	for j in range(G + 1):
		o = []
		for k in range(B + 1):
			o.append(-1)
		l.append(o)
	dp.append(l)
print(cal(0, 0, 0))


from math import *
from collections import *
from random import *
from decimal import Decimal
from heapq import *
from bisect import *
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 5)

def lis():
	return list(map(int, input().split()))

def ma():
	return map(int, input().split())

def inp():
	return int(input())

def st1():
	return input().rstrip('\n')
t = 1
while t:
	t -= 1
	(r, g, b) = ma()
	rl = lis()
	gl = lis()
	bl = lis()
	rl.sort()
	bl.sort()
	gl.sort()
	dp = [[[0] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i + j + k < 2:
					continue
				if i and j:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + rl[i - 1] * gl[j - 1])
				if j and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + gl[j - 1] * bl[k - 1])
				if i and k:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + rl[i - 1] * bl[k - 1])
	print(dp[r][g][b])


(nr, ng, nb) = map(int, input().split())
r = sorted([int(i) for i in input().split()])
g = sorted([int(i) for i in input().split()])
b = sorted([int(i) for i in input().split()])
dp = [[[0 for _ in range(nb + 1)] for _ in range(ng + 1)] for _ in range(nr + 1)]
for i in range(nr + 1):
	for j in range(ng + 1):
		for k in range(nb + 1):
			val = 0
			if i - 1 >= 0 and j - 1 >= 0:
				val = max(val, r[i - 1] * g[j - 1] + dp[i - 1][j - 1][k])
			if i - 1 >= 0 and k - 1 >= 0:
				val = max(val, r[i - 1] * b[k - 1] + dp[i - 1][j][k - 1])
			if j - 1 >= 0 and k - 1 >= 0:
				val = max(val, g[j - 1] * b[k - 1] + dp[i][j - 1][k - 1])
			dp[i][j][k] = val
print(dp[nr][ng][nb])


import sys
input = sys.stdin.readline

def f(r, g, b, n, m, k):
	if n >= 1 and m >= 1 or (k >= 1 and m >= 1) or (n >= 1 and k >= 1):
		a1 = mat[n][m][k]
		if a1 != -1:
			return a1
		else:
			a1 = 0
			b1 = 0
			c1 = 0
			if n >= 1 and m >= 1:
				a1 = r[n - 1] * g[m - 1] + f(r, g, b, n - 1, m - 1, k)
			if k >= 1 and m >= 1:
				b1 = b[k - 1] * g[m - 1] + f(r, g, b, n, m - 1, k - 1)
			if n >= 1 and k >= 1:
				c1 = r[n - 1] * b[k - 1] + f(r, g, b, n - 1, m, k - 1)
			mat[n][m][k] = max(a1, b1)
			mat[n][m][k] = max(mat[n][m][k], c1)
			return mat[n][m][k]
	return 0
(n, m, k) = list(map(int, input().split(' ')))
mat = [[[-1 for i in range(k + 1)] for j in range(m + 1)] for z in range(n + 1)]
r = list(map(int, input().split(' ')))
g = list(map(int, input().split(' ')))
b = list(map(int, input().split(' ')))
r.sort()
g.sort()
b.sort()
d = {}
print(f(r, g, b, n, m, k))


import sys
input = sys.stdin.readline
(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
r = [0] + r
g = [0] + g
b = [0] + b
R += 1
G += 1
B += 1
dp = [[[0] * B for _ in range(G)] for __ in range(R)]
res = 0
for i in range(R):
	for j in range(G):
		for k in range(B):
			tmp = 0
			if i > 0 and j > 0:
				tmp = max(tmp, dp[i - 1][j - 1][k] + r[i] * g[j])
			if i > 0 and k > 0:
				tmp = max(tmp, dp[i - 1][j][k - 1] + r[i] * b[k])
			if j > 0 and k > 0:
				tmp = max(tmp, dp[i][j - 1][k - 1] + g[j] * b[k])
			dp[i][j][k] = tmp
			res = max(res, tmp)
print(res)


def solve(rn, gn, bn, r, g, b):
	r = sorted(r, reverse=True)
	g = sorted(g, reverse=True)
	b = sorted(b, reverse=True)
	dp = [[[0 for k in range(bn + 1)] for j in range(gn + 1)] for i in range(rn + 1)]
	ans = 0
	for i in range(rn + 1):
		for j in range(gn + 1):
			for k in range(bn + 1):
				if i < rn and j < gn:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
				if i < rn and k < bn:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + r[i] * b[k])
				if j < gn and k < bn:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
				ans = max(ans, dp[i][j][k])
	print(ans)
(rn, gn, bn) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
solve(rn, gn, bn, r, g, b)


def dynamic(l1, l2, l3):
	count = 0
	for x in (l1, l2, l3):
		if x == 0:
			count += 1
	if count > 1:
		return 0
	elif dp[l1][l2][l3] != 0:
		return dp[l1][l2][l3]
	else:
		(x, y, z) = (0, 0, 0)
		if l1 and l2:
			x = max(dp[l1][l2][l3], dynamic(l1 - 1, l2 - 1, l3)) + ra[l1 - 1] * ga[l2 - 1]
		if l2 and l3:
			y = max(dp[l1][l2][l3], dynamic(l1, l2 - 1, l3 - 1)) + ga[l2 - 1] * ba[l3 - 1]
		if l1 and l3:
			z = max(dp[l1][l2][l3], dynamic(l1 - 1, l2, l3 - 1)) + ra[l1 - 1] * ba[l3 - 1]
		dp[l1][l2][l3] = max(x, max(y, z))
		return dp[l1][l2][l3]
(r, g, b) = map(int, input().split())
ra = list(map(int, input().split()))
ga = list(map(int, input().split()))
ba = list(map(int, input().split()))
ra.sort()
ga.sort()
ba.sort()
dp = [[[0 for _ in range(b + 1)] for _ in range(g + 1)] for _ in range(r + 1)]
tot = dynamic(r, g, b)
print(tot)


(c1, c2, c3) = map(int, input().split())
r = sorted(list(map(int, input().split())))
g = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
dp = [[[0 for i in range(c3 + 1)] for i in range(c2 + 1)] for i in range(c1 + 1)]
for i in range(c1 + 1):
	for j in range(c2 + 1):
		for k in range(c3 + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[c1][c2][c3])


def solve():
	(r, g, b) = map(int, input().split())
	(R, G, B) = (sorted(list(map(int, input().split()))), sorted(list(map(int, input().split()))), sorted(list(map(int, input().split()))))
	dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i > 0 and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1])
				if i > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i - 1] * B[k - 1])
				if j > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
	return dp[r][g][b]
print(solve())


(n, m, q) = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
b = sorted(map(int, input().split()), reverse=True)
c = sorted(map(int, input().split()), reverse=True)
dp = [[[0] * 201 for _ in range(201)] for _ in range(201)]
for ijk in range(n + m + q + 1):
	for i in range(min(n + 1, ijk + 1)):
		for j in range(min(m + 1, ijk - i + 1)):
			k = ijk - i - j
			if k < 0 or k > q:
				continue
			if i + 1 <= n:
				dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k])
			if j + 1 <= m:
				dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])
			if k + 1 <= q:
				dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k])
			if i + 1 <= n and j + 1 <= m:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[i] * b[j])
			if i + 1 <= n and k + 1 <= q:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[i] * c[k])
			if j + 1 <= m and k + 1 <= q:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + b[j] * c[k])
print(dp[n][m][q])


(r, g, b) = map(int, input().split(' '))
R = list(map(int, input().split(' ')))
G = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
dp = [[[-1 for i in range(b + 1)] for i in range(g + 1)] for i in range(r + 1)]
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
R.insert(0, 0)
G.insert(0, 0)
B.insert(0, 0)
(dp[0][0][0], ans) = (0, 0)
for i in range(0, r + 1):
	for j in range(0, g + 1):
		for k in range(0, b + 1):
			if i == 0 and j == 0 and (k == 0):
				continue
			if i and j and (dp[i - 1][j - 1][k] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i] * G[j])
			if k and j and (dp[i][j - 1][k - 1] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + B[k] * G[j])
			if i and k and (dp[i - 1][j][k - 1] != -1):
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + R[i] * B[k])
			ans = max(ans, dp[i][j][k])
print(ans)


from collections import deque
from collections import OrderedDict
import math
import sys
import os
import threading
import bisect
import operator
import heapq
from atexit import register
from io import BytesIO
import io
input = lambda : sys.stdin.readline().rstrip('\r\n')
(r, g, b) = map(int, input().split())
a = []
for i in range(3):
	a.append([int(x) for x in input().split()])
	a[i].sort(reverse=True)
dp = [[[0 for i in range(205)] for j in range(205)] for k in range(205)]
answer = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[0][i] * a[1][j])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[0][i] * a[2][k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + a[1][j] * a[2][k])
			answer = max(answer, dp[i][j][k])
print(answer)
sys.exit(0)

class Person:

	def __init__(self, name, age):
		self.name = name
		self.age = age
p1 = Person('heelo', 27)
print(help(Person))
age = 26
name = 'Swaroop'
print('Возрас {} -- {} лет'.format(name, age))
print(help(object))


from collections import defaultdict
T = 1

def solve():
	(R, G, B) = map(int, input().split())
	r = list(map(int, input().split()))
	g = list(map(int, input().split()))
	b = list(map(int, input().split()))
	r.sort()
	g.sort()
	b.sort()
	dp = [[[0 for _ in range(B + 1)] for _ in range(G + 1)] for _ in range(R + 1)]
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				if i > 0 and j > 0:
					dp[i][j][k] = max((dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1]))
				if j > 0 and k > 0:
					dp[i][j][k] = max((dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1]))
				if i > 0 and k > 0:
					dp[i][j][k] = max((dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1]))
	print(dp[R][G][B])
for t in range(T):
	solve()


import sys
input = sys.stdin.readline
(r, g, b) = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
z = list(map(int, input().split()))
x.sort(reverse=True)
y.sort(reverse=True)
z.sort(reverse=True)
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
dp[0][1][1] = y[0] * z[0]
dp[1][0][1] = x[0] * z[0]
dp[1][1][0] = x[0] * y[0]
for i in range(1, r):
	for j in range(1, g):
		dp[i][j][0] = max(dp[i][j][0], dp[i - 1][j - 1][0] + x[i - 1] * y[j - 1])
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(1, b + 1):
			dp[i][j][k] = dp[i][j][k - 1]
			if j != 0:
				dp[i][j][k] = max(dp[i][j - 1][k - 1] + y[j - 1] * z[k - 1], dp[i][j][k], dp[i][j - 1][k])
			if i != 0:
				dp[i][j][k] = max(dp[i - 1][j][k - 1] + x[i - 1] * z[k - 1], dp[i][j][k], dp[i - 1][j][k])
			if i != 0 and j != 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + x[i - 1] * y[j - 1])
print(dp[r][g][b])


def rec(r, g, b):
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	ans = 0
	if r < R and g < G:
		ans = max(ans, red[r] * green[g] + rec(r + 1, g + 1, b))
	if r < R and b < B:
		ans = max(ans, red[r] * blue[b] + rec(r + 1, g, b + 1))
	if b < B and g < G:
		ans = max(ans, blue[b] * green[g] + rec(r, g + 1, b + 1))
	dp[r][g][b] = ans
	return ans
(R, G, B) = map(int, input().split())
red = sorted(list(map(int, input().split())), reverse=True)
green = sorted(list(map(int, input().split())), reverse=True)
blue = sorted(list(map(int, input().split())), reverse=True)
dp = [[[-1] * (B + 1) for _ in range(G + 1)] for _ in range(R + 1)]
print(rec(0, 0, 0))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import gcd, ceil

def pre(s):
	n = len(s)
	pi = [0] * n
	for i in range(1, n):
		j = pi[i - 1]
		while j and s[i] != s[j]:
			j = pi[j - 1]
		if s[i] == s[j]:
			j += 1
		pi[i] = j
	return pi

def prod(a):
	ans = 1
	for each in a:
		ans = ans * each
	return ans

def lcm(a, b):
	return a * b // gcd(a, b)

def binary(x, length=16):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y
for _ in range(int(input()) if not True else 1):
	(r, g, b) = map(int, input().split())
	rr = list(map(int, input().split()))
	gg = list(map(int, input().split()))
	bb = list(map(int, input().split()))
	dp = [[[0] * (b + 1) for __ in range(g + 1)] for ___ in range(r + 1)]

	def f(a):
		return sorted(a, reverse=True)
	(rr, gg, bb) = (f(rr), f(gg), f(bb))
	ans = 0
	r += 1
	g += 1
	b += 1
	for i in range(r):
		for j in range(g):
			for k in range(b):
				try:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + rr[i] * gg[j])
				except:
					pass
				try:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + gg[j] * bb[k])
				except:
					pass
				try:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + rr[i] * bb[k])
				except:
					pass
				ans = max(ans, dp[i][j][k])
	print(ans)


def color(r, g, b):
	lst = [sorted(r, reverse=True), sorted(g, reverse=True), sorted(b, reverse=True)]
	dp = [[[0 for i in range(len(b) + 1)] for j in range(len(g) + 1)] for k in range(len(r) + 1)]
	ans = 0
	for i in range(len(r) + 1):
		for j in range(len(g) + 1):
			for k in range(len(b) + 1):
				if i < len(r) and j < len(g):
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + lst[0][i] * lst[1][j])
				if i < len(r) and k < len(b):
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + lst[0][i] * lst[2][k])
				if j < len(g) and k < len(b):
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + lst[1][j] * lst[2][k])
				ans = max(ans, dp[i][j][k])
	return ans
a = input()
ls1 = list(map(int, input().strip().split()))
ls2 = list(map(int, input().strip().split()))
ls3 = list(map(int, input().strip().split()))
print(color(ls1, ls2, ls3))


import sys, math
import io, os
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter

def data():
	return sys.stdin.readline().strip()

def mdata():
	return list(map(int, data().split()))

def outl(var):
	sys.stdout.write('\n'.join(map(str, var)) + '\n')

def out(var):
	sys.stdout.write(str(var) + '\n')
from decimal import Decimal
from fractions import Fraction
INF = float('inf')
mod = int(1000000000.0) + 7
from types import GeneratorType

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

@bootstrap
def recur(r, g, b):
	if r + b + g == r or r + b + g == g or r + b + g == b:
		yield 0
		return
	if dp[r][g][b]:
		yield dp[r][g][b]
		return
	if r > 0 and g > 0:
		dp[r][g][b] = max(dp[r][g][b], R[r - 1] * G[g - 1] + (yield recur(r - 1, g - 1, b)))
	if r > 0 and b > 0:
		dp[r][g][b] = max(dp[r][g][b], R[r - 1] * B[b - 1] + (yield recur(r - 1, g, b - 1)))
	if b > 0 and g > 0:
		dp[r][g][b] = max(dp[r][g][b], B[b - 1] * G[g - 1] + (yield recur(r, g - 1, b - 1)))
	yield dp[r][g][b]
(r, g, b) = mdata()
R = sorted(mdata())
G = sorted(mdata())
B = sorted(mdata())
dp = [[[0] * (b + 1) for i in range(g + 1)] for i in range(r + 1)]
out(recur(r, g, b))


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
(r, g, b) = ip()
R = [0] + ip()
G = [0] + ip()
B = [0] + ip()
R.sort()
G.sort()
B.sort()
dp = [[[0] * 201 for i in range(201)] for j in range(201)]
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			x = dp[i - 1][j - 1][k] + R[i] * G[j] if i * j else 0
			y = dp[i][j - 1][k - 1] + G[j] * B[k] if j * k else 0
			z = dp[i - 1][j][k - 1] + R[i] * B[k] if i * k else 0
			dp[i][j][k] = max(dp[i][j][k], x, y, z)
print(dp[r][g][b])


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def main():
	from functools import lru_cache
	(r, g, b) = map(int, input().split())
	red = [int(x) for x in input().split()]
	green = [int(x) for x in input().split()]
	blue = [int(x) for x in input().split()]
	red.sort(reverse=True)
	green.sort(reverse=True)
	blue.sort(reverse=True)
	dp = [[[0 for _ in range(b + 1)] for _ in range(g + 1)] for _ in range(r + 1)]
	result = 0
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i < r and j < g:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + red[i] * green[j])
				if i < r and k < b:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + red[i] * blue[k])
				if j < g and k < b:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + green[j] * blue[k])
				result = max(result, dp[i][j][k])
	print(result)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
input = lambda : sys.stdin.readline().strip()
char = [chr(i) for i in range(97, 123)]
CHAR = [chr(i) for i in range(65, 91)]
mp = lambda : list(map(int, input().split()))
INT = lambda : int(input())
rn = lambda : range(INT())
from math import ceil, sqrt, factorial, gcd
(r, g, b) = mp()
rl = sorted(mp(), reverse=True)
gl = sorted(mp(), reverse=True)
bl = sorted(mp(), reverse=True)

def solve(i, j, k):
	if dp_table[i][j][k] != -1:
		return dp_table[i][j][k]
	if i < r and j < g and (k < b):
		m = max(solve(i + 1, j + 1, k) + rl[i] * gl[j], solve(i + 1, j, k + 1) + rl[i] * bl[k], solve(i, j + 1, k + 1) + gl[j] * bl[k])
		dp_table[i][j][k] = m
		return m
	elif i < r and j < g:
		m = solve(i + 1, j + 1, b) + rl[i] * gl[j]
		dp_table[i][j][k] = m
		return m
	elif i < r and k < b:
		m = solve(i + 1, g, k + 1) + rl[i] * bl[k]
		dp_table[i][j][k] = m
		return m
	elif j < g and k < b:
		m = solve(r, j + 1, k + 1) + gl[j] * bl[k]
		dp_table[i][j][k] = m
		return m
	else:
		return 0
dp_table = [[[-1] * (b + 1) for j in range(g + 1)] for k in range(r + 1)]
res = solve(0, 0, 0)
print(res)


import sys
sys.setrecursionlimit(100000)
input = sys.stdin.readline

def solve(r, g, b, R, G, B):
	if (r == 0 and g == 0) and (r == 0 and b == 0) and (g == 0 and b == 0):
		return 0
	if z[r][g][b] != -1:
		return z[r][g][b]
	(d, e, f) = (0, 0, 0)
	if r != 0 and g != 0:
		d = R[r - 1] * G[g - 1] + solve(r - 1, g - 1, b, R, G, B)
	if r != 0 and b != 0:
		e = R[r - 1] * B[b - 1] + solve(r - 1, g, b - 1, R, G, B)
	if b != 0 and g != 0:
		f = B[b - 1] * G[g - 1] + solve(r, g - 1, b - 1, R, G, B)
	z[r][g][b] = max(d, e, f)
	return z[r][g][b]
(r, g, b) = map(int, input().split())
R = sorted(map(int, input().split()))
G = sorted(map(int, input().split()))
B = sorted(map(int, input().split()))
z = [[[-1 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
print(solve(r, g, b, R, G, B))


F = lambda : [int(x) for x in input().split()]
(R, G, B) = map(int, input().split())
r = F()
g = F()
b = F()
r.sort()
g.sort()
b.sort()
dp = [[[0] * 202 for _ in range(202)] for _ in range(202)]
ans = 0
for i in range(R, -1, -1):
	for j in range(G, -1, -1):
		for k in range(B, -1, -1):
			if i > 0 and j > 0:
				dp[i - 1][j - 1][k] = max(dp[i - 1][j - 1][k], dp[i][j][k] + r[i - 1] * g[j - 1])
				ans = max(ans, dp[i - 1][j - 1][k])
			if i > 0 and k > 0:
				dp[i - 1][j][k - 1] = max(dp[i - 1][j][k - 1], dp[i][j][k] + r[i - 1] * b[k - 1])
				ans = max(ans, dp[i - 1][j][k - 1])
			if j > 0 and k > 0:
				dp[i][j - 1][k - 1] = max(dp[i][j - 1][k - 1], dp[i][j][k] + g[j - 1] * b[k - 1])
				ans = max(ans, dp[i][j - 1][k - 1])
print(ans)


(r, g, b) = map(int, input().split())
red = list(map(int, input().split()))
green = list(map(int, input().split()))
blue = list(map(int, input().split()))
red.sort()
green.sort()
blue.sort()
red = red[::-1]
green = green[::-1]
blue = blue[::-1]
dp = []
for i in range(r + 1):
	temp = [[0] * (b + 1) for j in range(g + 1)]
	dp.append(temp)
answer = 0
for i in range(0, r + 1):
	for j in range(0, g + 1):
		for k in range(0, b + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + red[i - 1] * green[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + red[i - 1] * blue[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + green[j - 1] * blue[k - 1])
			answer = max(answer, dp[i][j][k])
print(answer)


import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(100000)

def solve(r, g, b, R, G, B):
	global z
	if (r == 0 and g == 0) and (r == 0 and b == 0) and (g == 0 and b == 0):
		return 0
	if z[r][g][b] != 0:
		return z[r][g][b]
	(d, e, f) = (0, 0, 0)
	if r != 0 and g != 0:
		d = R[r - 1] * G[g - 1] + solve(r - 1, g - 1, b, R, G, B)
	if r != 0 and b != 0:
		e = R[r - 1] * B[b - 1] + solve(r - 1, g, b - 1, R, G, B)
	if b != 0 and g != 0:
		f = B[b - 1] * G[g - 1] + solve(r, g - 1, b - 1, R, G, B)
	z[r][g][b] = max(d, e, f)
	return z[r][g][b]

def main():
	(r, g, b) = map(int, input().rstrip().split())
	R = sorted(map(int, input().rstrip().split()))
	G = sorted(map(int, input().rstrip().split()))
	B = sorted(map(int, input().rstrip().split()))
	global z
	z = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
	print(solve(r, g, b, R, G, B))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys

def dp(ri, gi, bi):
	if ri > r or gi > g or bi > b:
		return 0
	if not list_memo[ri][gi][bi] == -1:
		return list_memo[ri][gi][bi]
	list_memo[ri][gi][bi] = max(dp(ri + 1, gi + 1, bi) + r_c[ri] * g_c[gi], dp(ri + 1, gi, bi + 1) + r_c[ri] * b_c[bi], dp(ri, gi + 1, bi + 1) + g_c[gi] * b_c[bi])
	return list_memo[ri][gi][bi]
(r, g, b) = map(int, sys.stdin.readline().split())
r_c = sorted(list(map(int, sys.stdin.readline().split())) + [0], reverse=1)
g_c = sorted(list(map(int, sys.stdin.readline().split())) + [0], reverse=1)
b_c = sorted(list(map(int, sys.stdin.readline().split())) + [0], reverse=1)
list_memo = [[[-1] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
print(dp(0, 0, 0))


import sys
reader = (s.rstrip() for s in sys.stdin)
input = reader.__next__
sys.setrecursionlimit(200000)
(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
dp = [[[0 for i in range(b + 5)] for j in range(g + 5)] for k in range(r + 5)]

def solve(i, j, k):
	(x, y, z) = (0, 0, 0)
	if dp[i][j][k]:
		return dp[i][j][k]
	if i < r and j < g:
		x = R[i] * G[j] + solve(i + 1, j + 1, k)
	if i < r and k < b:
		y = R[i] * B[k] + solve(i + 1, j, k + 1)
	if j < g and k < b:
		z = G[j] * B[k] + solve(i, j + 1, k + 1)
	mx = max([x, y, z])
	dp[i][j][k] = mx
	return mx
print(solve(0, 0, 0))


from sys import stdin
input = lambda : stdin.readline().strip()
lin = lambda : list(map(int, input().split()))
iin = lambda : int(input())
main = lambda : map(int, input().split())
from math import ceil, sqrt, factorial, log
from collections import deque
from bisect import bisect_left

def gcd(a, b):
	(a, b) = (max(a, b), min(a, b))
	while a % b != 0:
		(a, b) = (b, a % b)
	return b

def solve():
	(a, b, c) = main()
	(x, y, z) = (lin(), lin(), lin())
	x.sort(reverse=True)
	y.sort(reverse=True)
	z.sort(reverse=True)
	ans = 0
	dp = [[[0 for i in range(c + 2)] for i in range(b + 2)] for i in range(a + 1)]
	for i in range(a + 1):
		for j in range(b + 1):
			for k in range(c + 1):
				if i < a and j < b:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + x[i] * y[j])
				if i < a and k < c:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + x[i] * z[k])
				if k < c and j < b:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + z[k] * y[j])
				ans = max(ans, dp[i][j][k])
	print(ans)
qwe = 1
for _ in range(qwe):
	solve()


from sys import stdin
(R, G, B) = map(int, stdin.readline().split())
r = list(map(int, stdin.readline().split()))
g = list(map(int, stdin.readline().split()))
b = list(map(int, stdin.readline().split()))
r.sort()
g.sort()
b.sort()
r.reverse()
g.reverse()
b.reverse()
dp = [[[0] * (B + 1) for i in range(G + 1)] for j in range(R + 1)]
ans = 0
for ri in range(R + 1):
	for gi in range(G + 1):
		for bi in range(B + 1):
			ans = max(ans, dp[ri][gi][bi])
			if ri < R and gi < G:
				dp[ri + 1][gi + 1][bi] = max(dp[ri + 1][gi + 1][bi], dp[ri][gi][bi] + r[ri] * g[gi])
			if gi < G and bi < B:
				dp[ri][gi + 1][bi + 1] = max(dp[ri][gi + 1][bi + 1], dp[ri][gi][bi] + b[bi] * g[gi])
			if ri < R and bi < B:
				dp[ri + 1][gi][bi + 1] = max(dp[ri + 1][gi][bi + 1], dp[ri][gi][bi] + r[ri] * b[bi])
print(ans)


import heapq
(r, g, b) = map(int, input().split())
(*rq,) = map(int, input().split())
(*gq,) = map(int, input().split())
(*bq,) = map(int, input().split())
rq.sort(reverse=True)
gq.sort(reverse=True)
bq.sort(reverse=True)
rq = [0] + rq
gq = [0] + gq
bq = [0] + bq
dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
ans = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + rq[i + 1] * gq[j + 1])
				ans = max(ans, dp[i + 1][j + 1][k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + gq[j + 1] * bq[k + 1])
				ans = max(ans, dp[i][j + 1][k + 1])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + rq[i + 1] * bq[k + 1])
				ans = max(ans, dp[i + 1][j][k + 1])
print(ans)


import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
import collections
from itertools import permutations
from collections import defaultdict
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
(R, G, B) = map(int, input().split())
r = sorted(list(map(int, input().split())))
g = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
dp = [[[0] * (B + 1) for j in range(G + 1)] for i in range(R + 1)]
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[R][G][B])


from functools import lru_cache
from sys import stdin, stdout
import sys
from math import *
sys.setrecursionlimit(int(200000.0))
(a, bb, c) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = []
for i in range(a + 1):
	temp = []
	for j in range(bb + 1):
		temp.append([-1] * (c + 1))
	dp.append(temp)

def func(x, y, z):
	if x == len(r) and y == len(g):
		return 0
	elif x == len(r) and z == len(b):
		return 0
	elif y == len(g) and z == len(b):
		return 0
	if dp[x][y][z] != -1:
		return dp[x][y][z]
	else:
		if x == len(r):
			ans = g[y] * b[z] + func(x, y + 1, z + 1)
		elif y == len(g):
			ans = r[x] * b[z] + func(x + 1, y, z + 1)
		elif z == len(b):
			ans = r[x] * g[y] + func(x + 1, y + 1, z)
		else:
			ans = max(g[y] * b[z] + func(x, y + 1, z + 1), r[x] * b[z] + func(x + 1, y, z + 1), r[x] * g[y] + func(x + 1, y + 1, z))
		dp[x][y][z] = ans
		return ans
rslt = func(0, 0, 0)
print(rslt)


(r, g, b) = list(map(int, input().split()))
x = list(map(int, input().split()))
y = list(map(int, input().split()))
z = list(map(int, input().split()))
x = sorted(x, reverse=True)
y = sorted(y, reverse=True)
z = sorted(z, reverse=True)
x.append(0)
y.append(0)
z.append(0)

def solution(red, green, blue):
	if dp[red][green][blue] == 0:
		a1 = x[red] * y[green]
		a2 = y[green] * z[blue]
		a3 = x[red] * z[blue]
		if r != red and g != green:
			a1 += solution(red + 1, green + 1, blue)
		if g != green and b != blue:
			a2 += solution(red, green + 1, blue + 1)
		if r != red and b != blue:
			a3 += solution(red + 1, green, blue + 1)
		dp[red][green][blue] = max(a1, a2, a3)
	return dp[red][green][blue]
dp = [[[0 for l in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
print(solution(0, 0, 0))


import sys, heapq as h
input = sys.stdin.readline

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input().strip()

def listStr():
	return list(input().strip())
import collections as col
import math

def solve():
	(R, G, B) = getInts()
	Reds = getInts()
	Greens = getInts()
	Blues = getInts()
	Reds.sort(reverse=True)
	Greens.sort(reverse=True)
	Blues.sort(reverse=True)
	dp = [[[0 for b in range(B + 1)] for g in range(G + 1)] for r in range(R + 1)]
	ans = 0
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				if i < R and j < G:
					dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + Reds[i] * Greens[j])
				if i < R and k < B:
					dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + Reds[i] * Blues[k])
				if j < G and k < B:
					dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + Greens[j] * Blues[k])
				ans = max(ans, dp[i][j][k])
	return ans
print(solve())


def solve(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	call = 0
	if i > 0 and j > 0:
		call = max(call, R[i] * G[j] + solve(i - 1, j - 1, k))
	if j > 0 and k > 0:
		call = max(call, G[j] * B[k] + solve(i, j - 1, k - 1))
	if k > 0 and i > 0:
		call = max(call, B[k] * R[i] + solve(i - 1, j, k - 1))
	dp[i][j][k] = call
	return call
(nr, ng, nb) = map(int, input().split())
R = [0] + list(map(int, input().split()))
G = [0] + list(map(int, input().split()))
B = [0] + list(map(int, input().split()))
R.sort()
G.sort()
B.sort()
dp = [[[-1] * (nb + 1) for j in range(ng + 1)] for i in range(nr + 1)]
ans = solve(nr, ng, nb)
print(ans)


n = list(map(int, input().split()))
u = []
u.append(list(map(int, input().split())))
u.append(list(map(int, input().split())))
u.append(list(map(int, input().split())))
u[0].sort(reverse=True)
u[1].sort(reverse=True)
u[2].sort(reverse=True)
res = 0
dp = [[[0] * (n[2] + 1) for _ in range(n[1] + 1)] for _ in range(n[0] + 1)]
for i in range(n[0] + 1):
	for j in range(n[1] + 1):
		for k in range(n[2] + 1):
			x0 = dp[i - 1][j - 1][k] + u[0][i - 1] * u[1][j - 1] if i and j else 0
			x1 = dp[i][j - 1][k - 1] + u[1][j - 1] * u[2][k - 1] if j and k else 0
			x2 = dp[i - 1][j][k - 1] + u[0][i - 1] * u[2][k - 1] if i and k else 0
			dp[i][j][k] = max(x0, x1, x2)
			res = max(res, dp[i][j][k])
print(res)


import math
import time
from collections import defaultdict, deque, Counter
from sys import stdin, stdout
from bisect import bisect_left, bisect_right
from queue import PriorityQueue
import sys
t = 1
for _ in range(t):
	(r, g, b) = map(int, stdin.readline().split())
	ra = list(map(int, stdin.readline().split()))
	ga = list(map(int, stdin.readline().split()))
	ba = list(map(int, stdin.readline().split()))
	ra.sort()
	ga.sort()
	ba.sort()
	dp = [[[0] * 201 for _ in range(201)] for _ in range(201)]
	for i in range(r + 1):
		for j in range(g + 1):
			for k in range(b + 1):
				if i and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + ra[i - 1] * ga[j - 1])
				if i and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + ra[i - 1] * ba[k - 1])
				if k and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + ga[j - 1] * ba[k - 1])
	print(dp[r][g][b])


(r, g, b) = list(map(int, input().split()))
rl = list(map(int, input().split()))
gl = list(map(int, input().split()))
bl = list(map(int, input().split()))
rl.sort(reverse=True)
gl.sort(reverse=True)
bl.sort(reverse=True)
a = [[[0] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]
maxi = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i and j:
				a[i][j][k] = a[i - 1][j - 1][k] + rl[i - 1] * gl[j - 1]
			if i and k:
				a[i][j][k] = max(a[i - 1][j][k - 1] + rl[i - 1] * bl[k - 1], a[i][j][k])
			if j and k:
				a[i][j][k] = max(a[i][j - 1][k - 1] + gl[j - 1] * bl[k - 1], a[i][j][k])
			maxi = max(a[i][j][k], maxi)
print(maxi)


import sys
buf = sys.stdin.read()
nowbuf = 0
endbuf = len(buf)

def getint():
	global nowbuf
	valnow = 0
	while buf[nowbuf] < '0' or buf[nowbuf] > '9':
		nowbuf += 1
	while nowbuf < endbuf and buf[nowbuf] >= '0' and (buf[nowbuf] <= '9'):
		valnow = valnow * 10 + int(buf[nowbuf])
		nowbuf += 1
	return valnow

def getstr():
	global nowbuf
	strnow = ''
	while buf[nowbuf] == ' ' or buf[nowbuf] == '\n':
		nowbuf += 1
	while nowbuf < endbuf and buf[nowbuf] != ' ' and (buf[nowbuf] != '\n'):
		strnow += buf[nowbuf]
		nowbuf += 1
	return strnow
R = getint()
G = getint()
B = getint()
r = [0 for i in range(R)]
g = [0 for i in range(G)]
b = [0 for i in range(B)]
for i in range(0, R):
	r[i] = getint()
for i in range(0, G):
	g[i] = getint()
for i in range(0, B):
	b[i] = getint()
r.sort()
g.sort()
b.sort()
dp = [[[0 for i in range(B + 2)] for i in range(G + 2)] for j in range(R + 2)]
for i in range(R, -1, -1):
	for j in range(G, -1, -1):
		for k in range(B, -1, -1):
			dp[i][j][k] = max(dp[i + 1][j][k], dp[i][j + 1][k], dp[i][j][k + 1])
			if i < R and j < G:
				dp[i][j][k] = max(dp[i][j][k], dp[i + 1][j + 1][k] + r[i] * g[j])
			if i < R and k < B:
				dp[i][j][k] = max(dp[i][j][k], dp[i + 1][j][k + 1] + r[i] * b[k])
			if j < G and k < B:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j + 1][k + 1] + g[j] * b[k])
print(dp[0][0][0])


(r, g, b) = map(int, input().split())
rsticks = list(map(int, input().split()))
gsticks = list(map(int, input().split()))
bsticks = list(map(int, input().split()))
rsticks.sort(reverse=True)
gsticks.sort(reverse=True)
bsticks.sort(reverse=True)
rp = 0
gp = 0
bp = 0
dp = []
for i in range(201):
	temp = []
	for j in range(201):
		temp.append([-1] * 201)
	dp.append(temp)

def recur(rp, gp, bp):
	l = [r - rp, g - gp, b - bp]
	l.sort()
	if l[1] <= 0:
		return 0
	if rp >= r:
		rp = 200
	if gp >= g:
		gp = 200
	if bp >= b:
		bp = 200
	if dp[rp][gp][bp] != -1:
		return dp[rp][gp][bp]
	a1 = 0
	a2 = 0
	a3 = 0
	if rp < r and gp < g:
		a1 = rsticks[rp] * gsticks[gp] + recur(rp + 1, gp + 1, bp)
	if rp < r and bp < b:
		a2 = rsticks[rp] * bsticks[bp] + recur(rp + 1, gp, bp + 1)
	if gp < g and bp < b:
		a3 = gsticks[gp] * bsticks[bp] + recur(rp, gp + 1, bp + 1)
	dp[rp][gp][bp] = max(a1, a2, a3)
	return max(a1, a2, a3)
print(recur(rp, gp, bp))


import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
	return int(input())

def rm():
	return map(int, input().split())

def rl():
	return list(map(int, input().split()))
(r, g, b) = rm()
R = rl()
G = rl()
B = rl()
R.sort()
G.sort()
B.sort()
dp = [[[0] * (b + 1) for j in range(g + 1)] for i in range(r + 1)]
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i and j:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1])
			if j and k:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
			if k and i:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + B[k - 1] * R[i - 1])
print(dp[r][g][b])


(R, G, B) = map(int, input().split())
L = [sorted(map(int, input().split())) for _ in range(3)]
DP = [0] * ((R + 1) * (G + 1) * (B + 1))

def idx(r, g, b):
	return r * (G + 1) * (B + 1) + g * (B + 1) + b
for r in range(R + 1):
	for g in range(G + 1):
		for b in range(B + 1):
			best = 0
			if r:
				if g:
					best = L[0][r - 1] * L[1][g - 1] + DP[idx(r - 1, g - 1, b)]
				if b:
					best = max(best, L[0][r - 1] * L[2][b - 1] + DP[idx(r - 1, g, b - 1)])
			if g and b:
				best = max(best, L[1][g - 1] * L[2][b - 1] + DP[idx(r, g - 1, b - 1)])
			DP[idx(r, g, b)] = best
print(max(DP))


(r, g, b) = map(int, input().split())
s1 = [int(x) for x in input().split()]
s2 = [int(x) for x in input().split()]
s3 = [int(x) for x in input().split()]
s1.sort()
s2.sort()
s3.sort()
s1 = s1[::-1]
s2 = s2[::-1]
s3 = s3[::-1]
s1 = [0] + s1
s2 = [0] + s2
s3 = [0] + s3
dp = []
for i in range(r + 5):
	H = []
	for j in range(g + 5):
		h = []
		for k in range(b + 5):
			h.append(0)
		H.append(h)
	dp.append(H)
for i in range(0, r + 1):
	for j in range(0, g + 1):
		for k in range(0, b + 1):
			(t1, t2, t3, t4, t5, t6) = (0, 0, 0, 0, 0, 0)
			if i - 1 >= 0 and j - 1 >= 0:
				t1 = dp[i - 1][j - 1][k] + s1[i] * s2[j]
			if i - 1 >= 0 and k - 1 >= 0:
				t2 = dp[i - 1][j][k - 1] + s1[i] * s3[k]
			if k - 1 >= 0 and j - 1 >= 0:
				t3 = dp[i][j - 1][k - 1] + s2[j] * s3[k]
			if i - 1 >= 0:
				t4 = dp[i - 1][j][k]
			if j - 1 >= 0:
				t5 = dp[i][j - 1][k]
			if k - 1 >= 0:
				t6 = dp[i][j][k - 1]
			dp[i][j][k] = max(t1, t2, t3, t4, t5, t6)
print(dp[r][g][b])


from sys import stdin
nii = lambda : map(int, stdin.readline().split())
lnii = lambda : list(map(int, stdin.readline().split()))
(R, G, B) = nii()
r = lnii()
g = lnii()
b = lnii()
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = [[[0] * (B + 1) for i in range(G + 1)] for j in range(R + 1)]
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			c = False
			if i < R and j < G:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + r[i] * g[j])
				c = True
			if j < G and k < B:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + g[j] * b[k])
				c = True
			if k < B and i < R:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + b[k] * r[i])
				c = True
			if not c:
				if i < R:
					dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k])
				if j < G:
					dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])
				if k < B:
					dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k])
ans = 0
for i in dp:
	for j in i:
		ans = max(ans, max(j))
print(ans)


(n, m, k) = map(int, input().split())
a = sorted(list(map(int, input().split())))
b = sorted(list(map(int, input().split())))
c = sorted(list(map(int, input().split())))
dp = [[[0] * (k + 1) for _ in range(m + 1)] for _ in range(n + 1)]
ans = 0
for i in range(0, n + 1):
	for j in range(0, m + 1):
		for ij in range(0, k + 1):
			if i and j:
				dp[i][j][ij] = max(dp[i][j][ij], dp[i - 1][j - 1][ij] + a[i - 1] * b[j - 1])
			if i and ij:
				dp[i][j][ij] = max(dp[i][j][ij], dp[i - 1][j][ij - 1] + a[i - 1] * c[ij - 1])
			if j and ij:
				dp[i][j][ij] = max(dp[i][j][ij], dp[i][j - 1][ij - 1] + b[j - 1] * c[ij - 1])
			ans = max(ans, dp[i][j][ij])
print(ans)


(r, g, b) = map(int, input().split())
a = [[], [], []]
dp = [[[0 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]
for x in range(3):
	a[x] = sorted([int(x) for x in input().split()])
odp = 0
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[0][i] * a[1][j])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[0][i] * a[2][k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + a[1][j] * a[2][k])
			odp = max(odp, dp[i][j][k])
print(odp)


import math, sys, bisect, heapq
from collections import defaultdict, Counter, deque
from itertools import groupby, accumulate
input = iter(sys.stdin.buffer.read().decode().splitlines()).__next__
ilele = lambda : map(int, input().split())
alele = lambda : list(map(int, input().split()))

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def Y(c):
	print(['NO', 'YES'][c])

def y(c):
	print(['no', 'yes'][c])

def Yy(c):
	print(['No', 'Yes'][c])
(r, g, b) = ilele()
R = alele()
G = alele()
B = alele()
R = sorted(R, reverse=True)
G = sorted(G, reverse=True)
B = sorted(B, reverse=True)
dp = list3d(r + 1, g + 1, b + 1, -1)

def fun(i=0, j=0, k=0):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	ans = 0
	if i < r and j < g:
		ans = max(ans, R[i] * G[j] + fun(i + 1, j + 1, k))
	if j < g and k < b:
		ans = max(ans, G[j] * B[k] + fun(i, j + 1, k + 1))
	if i < r and k < b:
		ans = max(ans, R[i] * B[k] + fun(i + 1, j, k + 1))
	dp[i][j][k] = ans
	return ans
print(fun())


import io
import os
from collections import Counter, defaultdict, deque

def solveBFS(NR, NG, NB, R, G, B):

	def pack(i, j, k):
		return i * 256 * 256 + j * 256 + k

	def unpack(ijk):
		(i, jk) = divmod(ijk, 256 * 256)
		(j, k) = divmod(jk, 256)
		return (i, j, k)
	R.sort(reverse=True)
	G.sort(reverse=True)
	B.sort(reverse=True)
	dp = [0 for i in range(256 ** 3)]
	q = deque([0])
	while q:
		ijk = q.popleft()
		d = dp[ijk]
		(i, j, k) = unpack(ijk)
		if i < NR:
			r = R[i]
		if j < NG:
			g = G[j]
		if k < NB:
			b = B[k]
		if i + 1 <= NR and j + 1 <= NG:
			rg = pack(i + 1, j + 1, k)
			dp[rg] = max(dp[rg], r * g + d)
			q.append(rg)
		if i + 1 <= NR and k + 1 <= NB:
			rb = pack(i + 1, j, k + 1)
			dp[rb] = max(dp[rb], r * b + d)
			q.append(rb)
		if j + 1 <= NG and k + 1 <= NB:
			gb = pack(i, j + 1, k + 1)
			dp[gb] = max(dp[gb], g * b + d)
			q.append(gb)
	return max(dp)

def solve(NR, NG, NB, R, G, B):
	assert NR == len(R)
	R.sort(reverse=True)
	G.sort(reverse=True)
	B.sort(reverse=True)
	R += [0]
	G += [0]
	B += [0]
	NR1 = NR + 2
	NG1 = NG + 2
	NB1 = NB + 2
	dp = [0 for i in range(NR1 * NG1 * NB1)]

	def pack(i, j, k):
		return i * NG1 * NB1 + j * NB1 + k
	inf = float('inf')
	for i in range(NR + 1):
		for j in range(NG + 1):
			dp[pack(i, j, -1)] = -inf
	for i in range(NR + 1):
		for k in range(NB + 1):
			dp[pack(i, -1, k)] = -inf
	for j in range(NG + 1):
		for k in range(NB + 1):
			dp[pack(-1, j, k)] = -inf
	for l in range(2, NR + NG + NB + 1, 2):
		for j in range(NG + 1):
			for k in range(NB + 1):
				i = l - j - k
				if i < 0 or i > NR:
					continue
				r = R[i - 1]
				g = G[j - 1]
				b = B[k - 1]
				dp[pack(i, j, k)] = max(r * g + dp[pack(i - 1, j - 1, k)], r * b + dp[pack(i - 1, j, k - 1)], b * g + dp[pack(i, j - 1, k - 1)])
	return max(dp)
if False:
	import random
	random.seed()
	N = 5
	for t in range(100):
		R = [random.randint(1, 10) for i in range(random.randint(1, N))]
		G = [random.randint(1, 10) for i in range(random.randint(1, N))]
		B = [random.randint(1, 10) for i in range(random.randint(1, N))]
		ans1 = solveBFS(len(R), len(G), len(B), R, G, B)
		ans2 = solve(len(R), len(G), len(B), R, G, B)
		if ans1 != ans2:
			print(ans1, ans2)
			print(R, G, B)
		exit()
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
(NR, NG, NB) = [int(x) for x in input().split()]
R = [int(x) for x in input().split()]
G = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
ans = solve(NR, NG, NB, R, G, B)
print(ans)


def answer(r, g, b, R, G, B, dp):
	if r == 0 and g == 0 or (b == 0 and g == 0) or (r == 0 and b == 0):
		return 0
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	if r == 0:
		dp[r][g][b] = B[b - 1] * G[g - 1] + answer(r, g - 1, b - 1, R, G, B, dp)
		return dp[r][g][b]
	if g == 0:
		dp[r][g][b] = R[r - 1] * B[b - 1] + answer(r - 1, g, b - 1, R, G, B, dp)
		return dp[r][g][b]
	if b == 0:
		dp[r][g][b] = R[r - 1] * G[g - 1] + answer(r - 1, g - 1, b, R, G, B, dp)
		return dp[r][g][b]
	if r != 0 and g != 0 and (b != 0):
		dp[r][g][b] = max(R[r - 1] * B[b - 1] + answer(r - 1, g, b - 1, R, G, B, dp), B[b - 1] * G[g - 1] + answer(r, g - 1, b - 1, R, G, B, dp), R[r - 1] * G[g - 1] + answer(r - 1, g - 1, b, R, G, B, dp))
		return dp[r][g][b]
(r, g, b) = map(int, input().split())
R = [int(i) for i in input().split()]
G = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
dp = [[[-1 for col in range(b + 1)] for col in range(g + 1)] for row in range(r + 1)]
R.sort()
B.sort()
G.sort()
print(answer(r, g, b, R, G, B, dp))


import sys
from functools import lru_cache
from collections import defaultdict
from collections import Counter
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
(R, G, B) = invr()
reds = sorted(inlt())
greens = sorted(inlt())
blues = sorted(inlt())
mem = [[[0 for _ in range(B + 1)] for _ in range(G + 1)] for _ in range(R + 1)]
ans = 0
for r in range(R + 1):
	for g in range(G + 1):
		for b in range(B + 1):
			if r + g + b < 2:
				mem[r][g][b] = 0
			if r < R and g < G:
				mem[r + 1][g + 1][b] = max(mem[r + 1][g + 1][b], mem[r][g][b] + reds[r] * greens[g])
			if r < R and b < B:
				mem[r + 1][g][b + 1] = max(mem[r + 1][g][b + 1], mem[r][g][b] + reds[r] * blues[b])
			if g < G and b < B:
				mem[r][g + 1][b + 1] = max(mem[r][g + 1][b + 1], mem[r][g][b] + greens[g] * blues[b])
			ans = max(mem[r][g][b], ans)
print(ans)


(R, G, B) = map(int, input().split())
r = [int(i) for i in input().split()]
g = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
r.sort(reverse=True)
g.sort(reverse=True)
b.sort(reverse=True)
dp = [[[0] * (B + 1) for _ in range(G + 1)] for _ in range(R + 1)]
answ = 0
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i < R and j < G:
				s1 = r[i] * g[j]
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], s1 + dp[i][j][k])
			if i < R and k < B:
				s2 = r[i] * b[k]
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], s2 + dp[i][j][k])
			if j < G and k < B:
				s3 = g[j] * b[k]
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], s3 + dp[i][j][k])
			answ = max(answ, dp[i][j][k])
print(answ)


(r, g, b) = map(int, input().split())
rs = list(map(int, input().split()))
gs = list(map(int, input().split()))
bs = list(map(int, input().split()))
rs.sort()
gs.sort()
bs.sort()
rs.reverse()
gs.reverse()
bs.reverse()
dp = [[[0] * 201 for x in range(201)] for y in range(201)]
for i in range(min(r, g) + 1):
	for j in range(min(g, b) + 1):
		for k in range(min(b, r) + 1):
			options = []
			if i == 0:
				pass
			elif i + k - 1 < r and i + j - 1 < g:
				options.append(dp[i - 1][j][k] + rs[i + k - 1] * gs[i + j - 1])
			else:
				options.append(dp[i - 1][j][k])
			if j == 0:
				pass
			elif i + j - 1 < g and j + k - 1 < b:
				options.append(dp[i][j - 1][k] + gs[i + j - 1] * bs[j + k - 1])
			else:
				options.append(dp[i][j - 1][k])
			if k == 0:
				pass
			elif j + k - 1 < b and i + k - 1 < r:
				options.append(dp[i][j][k - 1] + bs[j + k - 1] * rs[i + k - 1])
			else:
				options.append(dp[i][j][k - 1])
			if len(options) == 0:
				continue
			dp[i][j][k] = max(options)
print(dp[min(r, g)][min(g, b)][min(r, b)])


def solu(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	best = 0
	if i < r and j < g:
		best = max(best, R[i] * G[j] + solu(i + 1, j + 1, k))
	if j < g and k < b:
		best = max(best, B[k] * G[j] + solu(i, j + 1, k + 1))
	if k < b and i < r:
		best = max(best, R[i] * B[k] + solu(i + 1, j, k + 1))
	dp[i][j][k] = best
	return dp[i][j][k]
(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
area = 0
R = sorted(R, reverse=True)
G = sorted(G, reverse=True)
B = sorted(B, reverse=True)
dp = [[[-1 for j in range(201)] for k in range(201)] for l in range(201)]
ans = solu(0, 0, 0)
print(ans)


(n, m, v) = map(lambda x: int(x) + 1, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
dp = []
for i in range(n):
	dp.append([])
	for j in range(m):
		dp[i].append([0] * v)
a.sort(reverse=1)
b.sort(reverse=1)
c.sort(reverse=1)
a = [0] + a
b = [0] + b
c = [0] + c
ans = 0
for i in range(n):
	for j in range(m):
		for k in range(v):
			if i == j == k == 0:
				continue
			if i == j == 0 or i == k == 0 or j == k == 0:
				continue
			if i == 0:
				dp[i][j][k] = dp[i][j - 1][k - 1] + b[j] * c[k]
			elif j == 0:
				dp[i][j][k] = dp[i - 1][j][k - 1] + a[i] * c[k]
			elif k == 0:
				dp[i][j][k] = dp[i - 1][j - 1][k] + a[i] * b[j]
			else:
				dp[i][j][k] = max(dp[i - 1][j - 1][k] + a[i] * b[j], dp[i - 1][j][k - 1] + a[i] * c[k], dp[i][j - 1][k - 1] + b[j] * c[k])
			ans = max(ans, dp[i][j][k])
print(ans)


from sys import stdin, stdout
import math, sys, heapq
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import random
import bisect as bi

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def dict(a):
	d = {}
	for x in a:
		if d.get(x, -1) != -1:
			d[x] += 1
		else:
			d[x] = 1
	return d

def find_gt(a, x):
	i = bi.bisect_left(a, x)
	if i != len(a):
		return i
	else:
		return -1

def cal(r, g, b, dp, R, G, B, nr, ng, nb):
	if dp[r][g][b] != -1:
		return dp[r][g][b]
	best = 0
	if r < nr and g < ng:
		best = max(best, cal(r + 1, g + 1, b, dp, R, G, B, nr, ng, nb) + R[r] * G[g])
	if r < nr and b < nb:
		best = max(best, cal(r + 1, g, b + 1, dp, R, G, B, nr, ng, nb) + R[r] * B[b])
	if g < ng and b < nb:
		best = max(best, cal(r, g + 1, b + 1, dp, R, G, B, nr, ng, nb) + B[b] * G[g])
	dp[r][g][b] = best
	return dp[r][g][b]

def main():
	try:
		(nr, ng, nb) = In()
		dp = [[[-1 for x in range(201)] for y in range(201)] for z in range(201)]
		R = list(In())
		G = list(In())
		B = list(In())
		R.sort(reverse=True)
		G.sort(reverse=True)
		B.sort(reverse=True)
		print(cal(0, 0, 0, dp, R, G, B, nr, ng, nb))
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


(n, m, q) = map(int, input().split())
a = sorted(map(int, input().split()), reverse=True)
b = sorted(map(int, input().split()), reverse=True)
c = sorted(map(int, input().split()), reverse=True)
dp = [[[0] * (q + 1) for _ in range(m + 1)] for _ in range(n + 1)]
for i in range(n + 1):
	for j in range(m + 1):
		for k in range(q + 1):
			if i + 1 <= n:
				dp[i + 1][j][k] = max(dp[i + 1][j][k], dp[i][j][k])
			if j + 1 <= m:
				dp[i][j + 1][k] = max(dp[i][j + 1][k], dp[i][j][k])
			if k + 1 <= q:
				dp[i][j][k + 1] = max(dp[i][j][k + 1], dp[i][j][k])
			if i + 1 <= n and j + 1 <= m:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + a[i] * b[j])
			if i + 1 <= n and k + 1 <= q:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + a[i] * c[k])
			if j + 1 <= m and k + 1 <= q:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + b[j] * c[k])
print(dp[n][m][q])


from sys import stdin, stdout

def colored_rectangels(R, G, B, R_a, G_a, B_a):
	R += 1
	G += 1
	B += 1
	R_a.append(0)
	G_a.append(0)
	B_a.append(0)
	R_a.sort()
	G_a.sort()
	B_a.sort()
	dp = [[[0 for _ in range(B)] for _ in range(G)] for _ in range(R)]
	for i in range(0, R):
		for j in range(0, G):
			for k in range(0, B):
				r1 = r2 = r3 = 0
				if i > 0 and j > 0:
					r1 = dp[i - 1][j - 1][k] + R_a[i] * G_a[j]
				if j > 0 and k > 0:
					r2 = dp[i][j - 1][k - 1] + G_a[j] * B_a[k]
				if i > 0 and k > 0:
					r3 = dp[i - 1][j][k - 1] + R_a[i] * B_a[k]
				dp[i][j][k] = max(r1, r2, r3)
	return dp[R - 1][G - 1][B - 1]
(R, G, B) = map(int, stdin.readline().split())
R_a = list(map(int, stdin.readline().split()))
G_a = list(map(int, stdin.readline().split()))
B_a = list(map(int, stdin.readline().split()))
stdout.write(str(colored_rectangels(R, G, B, R_a, G_a, B_a)))


(r, g, b) = list(map(int, input().split()))
ls_r = sorted(list(map(int, input().split())))
ls_g = sorted(list(map(int, input().split())))
ls_b = sorted(list(map(int, input().split())))
dp = [[[None for _ in range(b + 1)] for _ in range(g + 1)] for _ in range(r + 1)]
for i in range(r + 1):
	dp[i][0][0] = 0
for i in range(g + 1):
	dp[0][i][0] = 0
for i in range(b + 1):
	dp[0][0][i] = 0
dp[1][1][0] = ls_r[0] * ls_g[0]
dp[0][1][1] = ls_g[0] * ls_b[0]
dp[1][0][1] = ls_r[0] * ls_b[0]
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			res1 = 0
			res2 = 0
			res3 = 0
			if i - 1 >= 0 and j - 1 >= 0:
				res1 += dp[i - 1][j - 1][k] + ls_r[i - 1] * ls_g[j - 1]
			if i - 1 >= 0 and k - 1 >= 0:
				res2 += dp[i - 1][j][k - 1] + ls_r[i - 1] * ls_b[k - 1]
			if j - 1 >= 0 and k - 1 >= 0:
				res3 += dp[i][j - 1][k - 1] + ls_g[j - 1] * ls_b[k - 1]
			dp[i][j][k] = max(res1, res2, res3)
print(dp[r][g][b])


(r, g, b) = list(map(int, input().split()))
dp = [[[-1] * (b + 1) for i in range(g + 1)] for j in range(r + 1)]
ra = sorted(list(map(int, input().split())), reverse=True)
ga = sorted(list(map(int, input().split())), reverse=True)
ba = sorted(list(map(int, input().split())), reverse=True)

def solve(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	if i == r:
		if j == g or k == b:
			return 0
		dp[i][j][k] = ga[j] * ba[k] + solve(i, j + 1, k + 1)
	elif j == g:
		if i == r or k == b:
			return 0
		dp[i][j][k] = ra[i] * ba[k] + solve(i + 1, j, k + 1)
	elif k == b:
		if j == g or i == r:
			return 0
		dp[i][j][k] = ga[j] * ra[i] + solve(i + 1, j + 1, k)
	else:
		dp[i][j][k] = max(ra[i] * ga[j] + solve(i + 1, j + 1, k), ra[i] * ba[k] + solve(i + 1, j, k + 1), ba[k] * ga[j] + solve(i, j + 1, k + 1))
	return dp[i][j][k]
print(solve(0, 0, 0))


n = list(map(int, input().split()))
u = []
u.append(list(map(int, input().split())))
u.append(list(map(int, input().split())))
u.append(list(map(int, input().split())))
u[0].sort(reverse=True)
u[1].sort(reverse=True)
u[2].sort(reverse=True)
res = 0
dp = [[[0] * (n[2] + 1) for _ in range(n[1] + 1)] for _ in range(n[0] + 1)]
for i in range(n[0] + 1):
	for j in range(n[1] + 1):
		for k in range(n[2] + 1):
			if i < n[0] and j < n[1]:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + u[0][i] * u[1][j])
			if j < n[1] and k < n[2]:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + u[1][j] * u[2][k])
			if i < n[0] and k < n[2]:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + u[0][i] * u[2][k])
res = max((x for u1 in dp for u2 in u1 for x in u2))
print(res)


from sys import stdin, gettrace
if gettrace():
	inputi = input
else:

	def input():
		return next(stdin)[:-1]

	def inputi():
		return stdin.buffer.readline()

def main():
	(r, g, b) = map(int, inputi().split())
	rr = list(sorted((int(a) for a in inputi().split())))
	gg = list(sorted((int(a) for a in inputi().split())))
	bb = list(sorted((int(a) for a in inputi().split())))
	dp = [[[0] * (b + 1) for _ in range(g + 1)] for _ in range(r + 1)]
	res = 0
	for i in range(r, -1, -1):
		for j in range(g, -1, -1):
			for k in range(b, -1, -1):
				if i > 0 and j > 0:
					dp[i - 1][j - 1][k] = max(dp[i - 1][j - 1][k], dp[i][j][k] + rr[i - 1] * gg[j - 1])
				if i > 0 and k > 0:
					dp[i - 1][j][k - 1] = max(dp[i - 1][j][k - 1], dp[i][j][k] + rr[i - 1] * bb[k - 1])
				if j > 0 and k > 0:
					dp[i][j - 1][k - 1] = max(dp[i][j - 1][k - 1], dp[i][j][k] + gg[j - 1] * bb[k - 1])
				res = max(res, dp[i - 1][j - 1][k], dp[i - 1][j][k - 1], dp[i][j - 1][k - 1])
	print(res)
main()


def helper(i, j, k, A, B, C, a, b, c, d):
	if i >= a and j >= b or (i >= a and k >= c) or (j >= b and k >= c):
		return 0
	if d[i][j][k] != -1:
		return d[i][j][k]
	ans = 0
	x = 0
	y = 0
	z = 0
	if i < a and j < b:
		x = A[i] * B[j] + helper(i + 1, j + 1, k, A, B, C, a, b, c, d)
	if i < a and k < c:
		y = A[i] * C[k] + helper(i + 1, j, k + 1, A, B, C, a, b, c, d)
	if j < b and k < c:
		z = B[j] * C[k] + helper(i, j + 1, k + 1, A, B, C, a, b, c, d)
	d[i][j][k] = max(x, y, z)
	return d[i][j][k]

def answer(a, b, c, A, B, C):
	A.sort(reverse=True)
	B.sort(reverse=True)
	C.sort(reverse=True)
	d = [[[-1 for i in range(202)] for j in range(202)] for k in range(202)]
	return helper(0, 0, 0, A, B, C, a, b, c, d)
(a, b, c) = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
print(answer(a, b, c, A, B, C))


from random import randint
mod = 10 ** 9 + 7
d = {}
(n, m, l) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

def go(i, j, k):
	val = i * 40401 + j * 201 + k
	ret = 0
	if val in d:
		return d[val]
	elif i < n and j < m and (k < l):
		ret = max(a[i] * b[j] + go(i + 1, j + 1, k), b[j] * c[k] + go(i, j + 1, k + 1), c[k] * a[i] + go(i + 1, j, k + 1))
	elif i < n and j < m:
		ret = a[i] * b[j] + go(i + 1, j + 1, k)
	elif j < m and k < l:
		ret = b[j] * c[k] + go(i, j + 1, k + 1)
	elif k < l and i < n:
		ret = c[k] * a[i] + go(i + 1, j, k + 1)
	d[val] = ret
	return ret
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
print(go(0, 0, 0))


def func(n1, n2, n3):
	global r, g, b
	if n1 < 0 and n2 < 0 or (n3 < 0 and n2 < 0) or (n1 < 0 and n3 < 0):
		return 0
	if n1 < 0:
		return g[n2] * b[n3] + func(n1, n2 - 1, n3 - 1)
	if n2 < 0:
		return r[n1] * b[n3] + func(n1 - 1, n2, n3 - 1)
	if n3 < 0:
		return g[n2] * r[n1] + func(n1 - 1, n2 - 1, n3)
	if dp[n1][n2][n3] == -1:
		dp[n1][n2][n3] = max(g[n2] * b[n3] + func(n1, n2 - 1, n3 - 1), r[n1] * b[n3] + func(n1 - 1, n2, n3 - 1), g[n2] * r[n1] + func(n1 - 1, n2 - 1, n3))
	return dp[n1][n2][n3]
(R, G, B) = tuple(map(int, input().split()))
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r = sorted(r)
g = sorted(g)
b = sorted(b)
prefix1 = [0] * R
prefix2 = [0] * G
prefix3 = [0] * B
prefix1[0] = r[0]
prefix2[0] = g[0]
prefix3[0] = b[0]
dp = [[[-1 for i in range(B)] for j in range(G)] for k in range(R)]
print(func(R - 1, G - 1, B - 1))


from collections import Counter
from itertools import accumulate
import sys
buff_readline = sys.stdin.readline
readline = sys.stdin.readline
INF = 2 ** 62 - 1

def read_int():
	return int(buff_readline())

def read_int_n():
	return list(map(int, buff_readline().split()))

def read_float():
	return float(buff_readline())

def read_float_n():
	return list(map(float, buff_readline().split()))

def read_str():
	return readline().strip()

def read_str_n():
	return readline().strip().split()

def error_print(*args):
	print(*args, file=sys.stderr)

def mt(f):
	import time

	def wrap(*args, **kwargs):
		s = time.time()
		ret = f(*args, **kwargs)
		e = time.time()
		error_print(e - s, 'sec')
		return ret
	return wrap

def slv(R, G, B):
	R.sort(reverse=True)
	G.sort(reverse=True)
	B.sort(reverse=True)
	RN = len(R)
	GN = len(G)
	BN = len(B)
	dp = [[[0] * (BN + 1) for _ in range(GN + 1)] for __ in range(RN + 1)]
	ans = 0
	for i in range(RN + 1):
		for j in range(GN + 1):
			for k in range(BN + 1):
				dp[i][j][k] = max(dp[i][j][k], 0 if not (i > 0 and j > 0) else dp[i - 1][j - 1][k] + R[i - 1] * G[j - 1], 0 if not (i > 0 and k > 0) else dp[i - 1][j][k - 1] + R[i - 1] * B[k - 1], 0 if not (j > 0 and k > 0) else dp[i][j - 1][k - 1] + G[j - 1] * B[k - 1])
				ans = max(ans, dp[i][j][k])
	return ans

def main():
	_ = read_int_n()
	R = read_int_n()
	G = read_int_n()
	B = read_int_n()
	print(slv(R, G, B))
main()


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log2, ceil
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import deque
from heapq import heappush, heappop, heapify
mod = int(1000000000.0) + 7
ip = lambda : int(stdin.readline())
inp = lambda : map(int, stdin.readline().split())
ips = lambda : stdin.readline().rstrip()
t = 1
for _ in range(t):
	(R, G, B) = inp()
	r = sorted(list(inp()))
	g = sorted(list(inp()))
	b = sorted(list(inp()))
	dp = [[[0] * (B + 1) for j in range(G + 1)] for i in range(R + 1)]
	for i in range(R + 1):
		for j in range(G + 1):
			for k in range(B + 1):
				if i > 0 and j > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
				if i > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
				if j > 0 and k > 0:
					dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
	ans = dp[R][G][B]
	print(ans)


(R, G, B) = map(int, input().split())
r = list(map(int, input().split()))
g = list(map(int, input().split()))
b = list(map(int, input().split()))
r.sort()
g.sort()
b.sort()
dp = []
for i in range(R + 1):
	d = []
	for j in range(G + 1):
		d.append([0] * (B + 1))
	dp.append(d)
for i in range(R + 1):
	for j in range(G + 1):
		for k in range(B + 1):
			if i + j + k < 2:
				continue
			if i > 0 and j > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - 1][k] + r[i - 1] * g[j - 1])
			if i > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k - 1] + r[i - 1] * b[k - 1])
			if j > 0 and k > 0:
				dp[i][j][k] = max(dp[i][j][k], dp[i][j - 1][k - 1] + g[j - 1] * b[k - 1])
print(dp[R][G][B])


import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq

def input():
	return sys.stdin.readline()[:-1]
INF = 10 ** 10
(NR, NG, NB) = map(int, input().split())
R = sorted(list(map(int, input().split())), reverse=True)
G = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
dp = [[[0 for _ in range(NB + 1)] for _ in range(NG + 1)] for _ in range(NR + 1)]
ans = 0
for ir in range(NR + 1):
	for ig in range(NG + 1):
		for ib in range(NB + 1):
			if ir < NR and ig < NG:
				v = dp[ir + 1][ig + 1][ib] = max(dp[ir + 1][ig + 1][ib], dp[ir][ig][ib] + R[ir] * G[ig])
				ans = max(ans, v)
			if ig < NG and ib < NB:
				v = dp[ir][ig + 1][ib + 1] = max(dp[ir][ig + 1][ib + 1], dp[ir][ig][ib] + G[ig] * B[ib])
				ans = max(ans, v)
			if ib < NB and ir < NR:
				v = dp[ir + 1][ig][ib + 1] = max(dp[ir + 1][ig][ib + 1], dp[ir][ig][ib] + B[ib] * R[ir])
				ans = max(ans, v)
print(ans)


import sys
input = sys.stdin.readline

def inInt():
	return int(input())

def inStr():
	return input().strip('\n')

def inIList():
	return list(map(int, input().split()))

def inSList():
	return input().split()

def solve(r, g, b, dp):
	for x in range(len(r) - 1, -1, -1):
		for y in range(len(g) - 1, -1, -1):
			for z in range(len(b) - 1, -1, -1):
				dp[x][y][z] = max(dp[x + 1][y + 1][z] + r[x] * g[y], dp[x][y + 1][z + 1] + g[y] * b[z], dp[x + 1][y][z + 1] + r[x] * b[z])
	return dp[0][0][0]
nums = inIList()
r = sorted(inIList(), reverse=True)
g = sorted(inIList(), reverse=True)
b = sorted(inIList(), reverse=True)
dp = [[[0 for z in range(len(b) + 1)] for y in range(len(g) + 1)] for x in range(len(r) + 1)]
for x in range(len(r) - 1, -1, -1):
	for y in range(len(g) - 1, -1, -1):
		dp[x][y][len(b)] = dp[x + 1][y + 1][len(b)] + r[x] * g[y]
for y in range(len(g) - 1, -1, -1):
	for z in range(len(b) - 1, -1, -1):
		dp[len(r)][y][z] = dp[len(r)][y + 1][z + 1] + g[y] * b[z]
for x in range(len(r) - 1, -1, -1):
	for z in range(len(b) - 1, -1, -1):
		dp[x][len(g)][z] = dp[x + 1][len(g)][z + 1] + r[x] * b[z]
print(solve(r, g, b, dp))


import sys
(p, q, r) = map(int, input().split())
a = []
for j in range(3):
	a.append([int(v) for v in sys.stdin.readline().split()])
a[0].sort(reverse=True)
a[1].sort(reverse=True)
a[2].sort(reverse=True)
dp = [[[0 for j in range(r + 1)] for k in range(q + 1)] for i in range(p + 1)]
ans = 0
for i in range(p + 1):
	for j in range(q + 1):
		for k in range(r + 1):
			if i < p and j < q:
				dp[i + 1][j + 1][k] = max(dp[i][j][k] + a[0][i] * a[1][j], dp[i + 1][j + 1][k])
			if j < q and k < r:
				dp[i][j + 1][k + 1] = max(dp[i][j][k] + a[1][j] * a[2][k], dp[i][j + 1][k + 1])
			if i < p and k < r:
				dp[i + 1][j][k + 1] = max(dp[i][j][k] + a[0][i] * a[2][k], dp[i + 1][j][k + 1])
			ans = max(ans, dp[i][j][k])
print(ans)


(r, g, b) = map(int, input().split())
R = list(map(int, input().split()))
G = list(map(int, input().split()))
B = list(map(int, input().split()))
R.sort()
G.sort()
B.sort()
dp = [[[-1 for i in range(b + 1)] for j in range(g + 1)] for k in range(r + 1)]

def solve(r, g, b):
	if r == 0 and g == 0 or (g == 0 and b == 0) or (b == 0 and r == 0):
		return 0
	if dp[r][g][b] == -1:
		if r == 0:
			ans = G[g - 1] * B[b - 1] + solve(r, g - 1, b - 1)
		elif g == 0:
			ans = R[r - 1] * B[b - 1] + solve(r - 1, g, b - 1)
		elif b == 0:
			ans = G[g - 1] * R[r - 1] + solve(r - 1, g - 1, b)
		else:
			ans = max(G[g - 1] * B[b - 1] + solve(r, g - 1, b - 1), G[g - 1] * R[r - 1] + solve(r - 1, g - 1, b), R[r - 1] * B[b - 1] + solve(r - 1, g, b - 1))
		dp[r][g][b] = ans
	return dp[r][g][b]
ans = solve(r, g, b)
print(ans)


import sys, math
input = sys.stdin.readline

def allWays(i, j, k):
	if dp[i][j][k] != -1:
		return dp[i][j][k]
	ans = 0
	if i < r and j < g:
		ans = max(ans, allWays(i + 1, j + 1, k) + lr[i] * lg[j])
	if i < r and k < b:
		ans = max(ans, allWays(i + 1, j, k + 1) + lr[i] * lb[k])
	if k < b and j < g:
		ans = max(ans, allWays(i, j + 1, k + 1) + lb[k] * lg[j])
	dp[i][j][k] = ans
	return ans
(r, g, b) = map(int, input().split())
lr = list(map(int, input().split()))
lg = list(map(int, input().split()))
lb = list(map(int, input().split()))
lr.sort(reverse=True)
lg.sort(reverse=True)
lb.sort(reverse=True)
dp = []
length = max([r, g, b])
for i in range(202):
	temp = []
	for j in range(202):
		temp2 = [-1] * 202
		temp.append(temp2)
	dp.append(temp)
print(allWays(0, 0, 0))


import sys
input = sys.stdin.readline
(r, g, b) = map(int, input().split())
dp = [[[0 for i in range(202)] for j in range(202)] for k in range(202)]
R = [int(x) for x in input().split()]
G = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
ans = 0
R.sort(reverse=True)
G.sort(reverse=True)
B.sort(reverse=True)
for i in range(r + 1):
	for j in range(g + 1):
		for k in range(b + 1):
			if i < r and j < g:
				dp[i + 1][j + 1][k] = max(dp[i + 1][j + 1][k], dp[i][j][k] + R[i] * G[j])
			if i < r and k < b:
				dp[i + 1][j][k + 1] = max(dp[i + 1][j][k + 1], dp[i][j][k] + R[i] * B[k])
			if j < g and k < b:
				dp[i][j + 1][k + 1] = max(dp[i][j + 1][k + 1], dp[i][j][k] + G[j] * B[k])
			ans = max(ans, dp[i][j][k])
print(ans)