#include <bits/stdc++.h>
using namespace std;
long long dp[(long long)(2e2 + 10)][(long long)(2e2 + 10)]
            [(long long)(2e2 + 10)] = {};
void solve() {
  long long n, m, p;
  cin >> n >> m >> p;
  vector<long long> a(n), b(m), c(p);
  for (long long &i : a) cin >> i;
  for (long long &i : b) cin >> i;
  for (long long &i : c) cin >> i;
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  for (long long i = n; i >= 0; i--) {
    for (long long j = m; j >= 0; j--) {
      for (long long k = p; k >= 0; k--) {
        long long &ans = dp[i][j][k];
        if (i < n) ans = max(ans, dp[i + 1][j][k]);
        if (j < m) ans = max(ans, dp[i][j + 1][k]);
        if (k < p) ans = max(ans, dp[i][j][k + 1]);
        if (i < n and j < m)
          ans = max(ans, dp[i + 1][j + 1][k] + (a[i] * b[j]));
        if (i < n and k < p)
          ans = max(ans, dp[i + 1][j][k + 1] + (a[i] * c[k]));
        if (j < m and k < p)
          ans = max(ans, dp[i][j + 1][k + 1] + (b[j] * c[k]));
      }
    }
  }
  cout << dp[0][0][0] << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(nullptr), cin.tie(nullptr);
  long long t_c = 1;
  while (t_c--) solve();
}
