s = input().split(" ") na = int(s[0]) nb = int(s[1]) nc = int(s[2]) A_MAX = 3000 def read(n, arr_cnt, arr_sum): s = input().split(" ") for i in range(n): x = int(s[i]) arr_cnt[x + A_MAX] += 1 arr_sum[x + A_MAX] += x for i in range(A_MAX * 2, 0, -1): arr_cnt[i - 1] += arr_cnt[i] arr_sum[i - 1] += arr_sum[i] a_cnt = [0] * (2 * A_MAX + 1) a_sum = [0] * (2 * A_MAX + 1) read(na, a_cnt, a_sum) b_cnt = [0] * (2 * A_MAX + 1) b_sum = [0] * (2 * A_MAX + 1) read(nb, b_cnt, b_sum) c_cnt = [0] * (2 * A_MAX + 1) c_sum = [0] * (2 * A_MAX + 1) read(nc, c_cnt, c_sum) ans = 0 for j in range(A_MAX * 2 + 1): for k in range(A_MAX * 2 + 1): if b_cnt[j] == 0: ans = max(ans, max(0, na * c_sum[k]) + b_sum[j] * c_cnt[k]) else: x = (-c_sum[k] - 1) // b_cnt[j] + 1 c = 0 if x > A_MAX else a_cnt[max(0, x + A_MAX)] s = 0 if x > A_MAX else a_sum[max(0, x + A_MAX)] ans = max(ans, s * b_cnt[j] + b_sum[j] * c_cnt[k] + c_sum[k] * c) print(ans)