#include <bits/stdc++.h>
const int N = (int)1e5 + 7;
const int MOD = (int)1e9 + 7;
const long long INF = (long long)1e18;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    long long a, b, c, i, j, k, maxi = 0;
    cin >> a >> b >> c;
    vector<int> A(a), B(b), C(c);
    vector<vector<vector<long long>>> dp(
        a + 1, vector<vector<long long>>(b + 1, vector<long long>(c + 1)));
    for (i = 0; i < a; i++) cin >> A[i];
    for (i = 0; i < b; i++) cin >> B[i];
    for (i = 0; i < c; i++) cin >> C[i];
    sort(A.begin(), A.end());
    reverse(A.begin(), A.end());
    sort(B.begin(), B.end());
    reverse(B.begin(), B.end());
    sort(C.begin(), C.end());
    reverse(C.begin(), C.end());
    for (i = 0; i <= a; i++) {
      for (j = 0; j <= b; j++) {
        for (k = 0; k <= c; k++) {
          if (i && j && k) {
            dp[i][j][k] = max({dp[i - 1][j - 1][k] + A[i - 1] * B[j - 1],
                               dp[i][j - 1][k - 1] + B[j - 1] * C[k - 1],
                               dp[i - 1][j][k - 1] + A[i - 1] * C[k - 1]});
          } else if (i && j) {
            dp[i][j][k] = dp[i - 1][j - 1][k] + A[i - 1] * B[j - 1];
          } else if (j && k) {
            dp[i][j][k] = dp[i][j - 1][k - 1] + C[k - 1] * B[j - 1];
          } else if (k && i) {
            dp[i][j][k] = dp[i - 1][j][k - 1] + A[i - 1] * C[k - 1];
          }
          maxi = max(maxi, dp[i][j][k]);
        }
      }
    }
    cout << maxi << '\n';
  }
  return 0;
}
