#include <bits/stdc++.h>
using namespace std;
const int nax = 5e4 + 5;
int main() {
  int r, g, b;
  cin >> r >> g >> b;
  vector<int> x(r), y(g), z(b);
  for (auto &m : x) cin >> m;
  for (auto &m : y) cin >> m;
  for (auto &m : z) cin >> m;
  sort(x.begin(), x.end(), greater<int>());
  sort(y.begin(), y.end(), greater<int>());
  sort(z.begin(), z.end(), greater<int>());
  vector<vector<vector<int>>> dp(
      r + 1, vector<vector<int>>(g + 1, vector<int>(b + 1, 0)));
  for (int i = 0; i <= r; i++) {
    for (int j = 0; j <= g; j++) {
      for (int k = 0; k <= b; k++) {
        if (i > 0 && j > 0)
          dp[i][j][k] =
              max(x[i - 1] * y[j - 1] + dp[i - 1][j - 1][k], dp[i][j][k]);
        if (j > 0 && k > 0)
          dp[i][j][k] =
              max(z[k - 1] * y[j - 1] + dp[i][j - 1][k - 1], dp[i][j][k]);
        if (i > 0 && k > 0)
          dp[i][j][k] =
              max(x[i - 1] * z[k - 1] + dp[i - 1][j][k - 1], dp[i][j][k]);
        if (i > 0) dp[i][j][k] = max(dp[i - 1][j][k], dp[i][j][k]);
        if (j > 0) dp[i][j][k] = max(dp[i][j - 1][k], dp[i][j][k]);
        if (k > 0) dp[i][j][k] = max(dp[i][j][k - 1], dp[i][j][k]);
      }
    }
  }
  cout << dp[r][g][b];
  return 0;
}
