#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long int r, g, b;
  cin >> r >> g >> b;
  vector<long long int> R(r), G(g), B(b);
  for (long long int i = 0; i < r; i++) cin >> R[i];
  for (long long int i = 0; i < g; i++) cin >> G[i];
  for (long long int i = 0; i < b; i++) cin >> B[i];
  sort(R.begin(), R.end(), greater<long long int>());
  sort(G.begin(), G.end(), greater<long long int>());
  sort(B.begin(), B.end(), greater<long long int>());
  long long int dp[r + 1][g + 1][b + 1];
  for (long long int i = 0; i <= r; i++) {
    for (long long int j = 0; j <= g; j++) {
      for (long long int k = 0; k <= b; k++) {
        dp[i][j][k] = -1;
      }
    }
  }
  for (long long int i = 0; i <= r; i++) dp[i][0][0] = 0;
  for (long long int i = 0; i <= g; i++) dp[0][i][0] = 0;
  for (long long int i = 0; i <= b; i++) dp[0][0][i] = 0;
  long long int res = 0;
  for (long long int i = 0; i <= r; i++) {
    for (long long int j = 0; j <= g; j++) {
      for (long long int k = 0; k <= b; k++) {
        long long int mx = INT_MIN;
        if (dp[i][j][k] == -1) {
          if (i > 0 && j > 0) {
            mx = max(mx, R[i - 1] * G[j - 1] + dp[i - 1][j - 1][k]);
          }
          if (i > 0 && k > 0) {
            mx = max(mx, R[i - 1] * B[k - 1] + dp[i - 1][j][k - 1]);
          }
          if (j > 0 && k > 0) {
            mx = max(mx, G[j - 1] * B[k - 1] + dp[i][j - 1][k - 1]);
          }
          dp[i][j][k] = mx;
          res = max(res, mx);
        }
      }
    }
  }
  cout << res;
  return 0;
}
