#include #include using namespace std; using namespace atcoder; struct Fast { Fast() { std::cin.tie(nullptr); ios::sync_with_stdio(false); cout << setprecision(10); } } fast; #define rep(i, a, b) for (int(i) = (a); (i) < (int)(b); (i)++) #define all(a) (a).begin(), (a).end() using ll = long long; const ll INF = 1e18; int main() { int na, nb, nc; cin >> na >> nb >> nc; auto read = [](const int n) { vector ret(n); rep(i, 0, n) cin >> ret[i]; sort(all(ret)); reverse(all(ret)); ret.insert(ret.begin(), 0); rep(i, 0, n) ret[i + 1] += ret[i]; return ret; }; auto a = read(na); auto b = read(nb); auto c = read(nc); auto h = [a, b, c](const int u, const int v, const int w) -> ll { return a[u] * v + b[v] * w + c[w] * u; }; auto g = [h, nc](const int u, const int v) -> ll { int l = 0, r = nc; while (r - l >= 3) { int x1 = l + (r - l) / 3; int x2 = r - (r - l) / 3; if (h(u, v, x1) >= h(u, v, x2)) r = x2; else l = x1; } ll ret = -INF; rep(i, l, r + 1) ret = max(ret, h(u, v, i)); return ret; }; auto f = [g, nb](const int u) -> ll { int l = 0, r = nb; while (r - l >= 3) { int x1 = l + (r - l) / 3; int x2 = r - (r - l) / 3; if (g(u, x1) >= g(u, x2)) r = x2; else l = x1; } ll ret = -INF; rep(i, l, r + 1) ret = max(ret, g(u, i)); return ret; }; ll ans = 0; rep(i, 0, na + 1) ans = max(ans, f(i)); cout << ans << endl; }