#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1e18;
struct vl {
  long long x, y;
  bool operator<(vl t) const {
    if (x == t.x) return y < t.y;
    return x < t.x;
  }
};
const long long MAXN = 2e2 + 69;
long long m, n, q, x, y, z, t, k;
long long a[MAXN];
long long b[MAXN];
long long c[MAXN];
long long dp[MAXN][MAXN][MAXN];
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> x >> y >> z;
  for (long long i = 1; i <= x; i++) cin >> a[i];
  sort(a + 1, a + x + 1);
  for (long long i = 1; i <= y; i++) cin >> b[i];
  sort(b + 1, b + y + 1);
  for (long long i = 1; i <= z; i++) cin >> c[i];
  sort(c + 1, c + z + 1);
  for (long long i = 0; i <= x; i++) {
    for (long long j = 0; j <= y; j++) {
      for (long long k = 0; k <= z; k++) {
        dp[i][j][k] =
            max({i >= 1 && j >= 1 ? dp[i - 1][j - 1][k] + a[i] * b[j] : 0,
                 i >= 1 && k >= 1 ? dp[i - 1][j][k - 1] + a[i] * c[k] : 0,
                 j >= 1 && k >= 1 ? dp[i][j - 1][k - 1] + b[j] * c[k] : 0});
      }
    }
  }
  cout << dp[x][y][z];
}
