#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int R, G, B;
  cin >> R >> G >> B;
  long long r[R];
  long long g[G];
  long long b[B];
  for (int i = 0; i < R; i++) {
    cin >> r[i];
    r[i] = -r[i];
  }
  for (int i = 0; i < G; i++) {
    cin >> g[i];
    g[i] = -g[i];
  }
  for (int i = 0; i < B; i++) {
    cin >> b[i];
    b[i] = -b[i];
  }
  sort(r, r + R);
  sort(g, g + G);
  sort(b, b + B);
  long long dp[R + 2][G + 2][B + 2];
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i <= R; i++) {
    for (int a = 0; a <= G; a++) {
      for (int bb = 0; bb <= B; bb++) {
        dp[i + 1][a + 1][bb] =
            max(dp[i + 1][a + 1][bb], dp[i][a][bb] + r[i] * g[a]);
        dp[i + 1][a][bb + 1] =
            max(dp[i + 1][a][bb + 1], dp[i][a][bb] + r[i] * b[bb]);
        dp[i][a + 1][bb + 1] =
            max(dp[i][a + 1][bb + 1], dp[i][a][bb] + g[a] * b[bb]);
      }
    }
  }
  long long maxx = 0;
  for (int i = 0; i < R + 1; i++) {
    for (int a = 0; a < G + 1; a++) {
      for (int bb = 0; bb < B + 1; bb++) {
        maxx = max(maxx, dp[i][a][bb]);
      }
    }
  }
  cout << maxx << endl;
}
