#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
inline long long read() {
  long long x = 0, f = 1;
  char c =
      (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  }
  while (isdigit(c)) {
    x = (x << 3) + (x << 1) + (c ^ 48);
    c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  }
  return x * f;
}
const long long N = 220;
long long a[N], b[N], c[N];
long long tota, totb, totc;
long long dp[N][N][N];
long long res;
signed main() {
  tota = read();
  totb = read();
  totc = read();
  for (long long i = 0; i < tota; i++) a[i] = read();
  for (long long i = 0; i < totb; i++) b[i] = read();
  for (long long i = 0; i < totc; i++) c[i] = read();
  sort(a, a + tota);
  sort(b, b + totb);
  sort(c, c + totc);
  for (long long i = 0; i <= tota; i++) {
    for (long long j = 0; j <= totb; j++) {
      for (long long k = 0; k <= totc; k++) {
        if (i && j)
          dp[i][j][k] =
              max(dp[i][j][k], dp[i - 1][j - 1][k] + a[i - 1] * b[j - 1]);
        if (j && k)
          dp[i][j][k] =
              max(dp[i][j][k], dp[i][j - 1][k - 1] + b[j - 1] * c[k - 1]);
        if (i && k)
          dp[i][j][k] =
              max(dp[i][j][k], dp[i - 1][j][k - 1] + a[i - 1] * c[k - 1]);
      }
    }
  }
  printf("%lld", dp[tota][totb][totc]);
}
