#include <bits/stdc++.h>
using namespace std;
int n, m, k;
vector<int> r;
vector<int> g;
vector<int> b;
long long int dp[201][201][201];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  r = vector<int>(n, 0);
  g = vector<int>(m, 0);
  b = vector<int>(k, 0);
  for (int i = 0; i < n; i++) cin >> r[i];
  for (int i = 0; i < m; i++) cin >> g[i];
  for (int i = 0; i < k; i++) cin >> b[i];
  sort(r.begin(), r.end(), greater<int>());
  sort(g.begin(), g.end(), greater<int>());
  sort(b.begin(), b.end(), greater<int>());
  memset(dp, 0, sizeof(dp));
  for (int i = n; i >= 0; i--) {
    for (int j = m; j >= 0; j--) {
      for (int l = k; l >= 0; l--) {
        if (i != n && j != m && l != k)
          dp[i][j][l] = max({r[i] * g[j] + dp[i + 1][j + 1][l],
                             g[j] * b[l] + dp[i][j + 1][l + 1],
                             r[i] * b[l] + dp[i + 1][j][l + 1]});
        else if (i != n && j != m)
          dp[i][j][l] = r[i] * g[j] + dp[i + 1][j + 1][l];
        else if (i != n && l != k)
          dp[i][j][l] = r[i] * b[l] + dp[i + 1][j][l + 1];
        else if (j != m && l != k)
          dp[i][j][l] = g[j] * b[l] + dp[i][j + 1][l + 1];
      }
    }
  }
  cout << dp[0][0][0];
  return 0;
}
