#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
bool comp(pair<long long, long long> p, pair<long long, long long> q) {
  if (p.first != q.first)
    return p.first < q.first;
  else
    return p.second > q.second;
}
long long power(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n % 2) res = (res % mod * a % mod) % mod;
    a = (a % mod * a % mod) % mod;
    n /= 2;
  }
  return res % mod;
}
long long dp[200][200][200];
long long solve(long long i, long long j, long long k, long long r[],
                long long g[], long long b[], long long &ans) {
  if (((i >= 0) + (j >= 0) + (k >= 0)) < 2) {
    return 0;
  } else if (i == -1)
    return g[j] * b[k] + solve(i, j - 1, k - 1, r, g, b, ans);
  else if (j == -1)
    return r[i] * b[k] + solve(i - 1, j, k - 1, r, g, b, ans);
  else if (k == -1)
    return g[j] * r[i] + solve(i - 1, j - 1, k, r, g, b, ans);
  else if (i != -1 && j != -1 && k != -1) {
    if (dp[i][j][k] != -1) return dp[i][j][k];
    long long x = g[j] * b[k] + solve(i, j - 1, k - 1, r, g, b, ans);
    long long y = r[i] * b[k] + solve(i - 1, j, k - 1, r, g, b, ans);
    long long z = g[j] * r[i] + solve(i - 1, j - 1, k, r, g, b, ans);
    return dp[i][j][k] = max(x, max(y, z));
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t, l, n, m;
  t = 1;
  while (t--) {
    cin >> l >> m >> n;
    long long r[l], g[m], b[n], i = l - 1, j = m - 1, k = n - 1, ans = 0;
    for (long long i = 0; i < 200; i++)
      for (long long j = 0; j < 200; j++)
        for (long long k = 0; k < 200; k++) dp[i][j][k] = -1;
    for (long long i = 0; i < l; i++) cin >> r[i];
    for (long long i = 0; i < m; i++) cin >> g[i];
    for (long long i = 0; i < n; i++) cin >> b[i];
    sort(r, r + l);
    sort(g, g + m);
    sort(b, b + n);
    solve(i, j, k, r, g, b, ans);
    cout << dp[l - 1][m - 1][n - 1] << "\n";
  }
}
