#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
int red[201];
int green[201];
int blue[201];
int dp[201][201][201];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= 200 or gpos >= 200 or bpos >= 200) {
            return 0;
      }
      /*
      if (rpos >= r and gpos >= g) {
            return 0;
      }
      if (rpos >= r and bpos >= b) {
            return 0;
      }
      if (gpos >= g and bpos >= b) {
            return 0;
      }
      */
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = solve(rpos + 1, gpos, bpos);
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos));
      MAX(ret, solve(rpos + 1, gpos, bpos + 1));
      MAX(ret, solve(rpos, gpos + 1, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos + 1));
      {
            int go = (red[rpos] * green[gpos]) + solve(rpos + 1, gpos + 1, bpos);
            MAX(ret, go);
      }
      {
            int go = (red[rpos] * blue[bpos]) + solve(rpos + 1, gpos, bpos + 1);
            MAX(ret, go);
      }
      {
            int go = (green[gpos] * blue[bpos]) + solve(rpos, gpos + 1, bpos + 1);
            MAX(ret, go);
      }
      /*
      if (rpos < r) {
            if (gpos < g) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (gpos < g) {
            if (rpos < r) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (bpos < b) {
            if (rpos < r) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
            if (gpos < g) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      */
//      debug(rpos, gpos, bpos, ret);
      return ret;
}

void Task() {
      /*
      int r, g, b;
      cin >> r >> g >> b;
      multiset <int> aliveRed;
      multiset <int> aliveGreen;
      multiset <int> aliveBlue;
      multiset <pii> alive;
      int RED = 1;
      int GREEN = 2;
      int BLUE = 3;
      for (int i = 1; i <= r; i++) {
            int x;
            cin >> x;
            aliveRed.insert(x);
            alive.insert(mk(x, 1));
      }
      for (int i = 1; i <= g; i++) {
            int x;
            cin >> x;
            aliveGreen.insert(x);
            alive.insert(mk(x, 2));
      }
      for (int i = 1; i <= b; i++) {
            int x;
            cin >> x;
            aliveBlue.insert(x);
            alive.insert(mk(x, 3));
      }
      int area = 0;
      while (alive.size()) {
            debug(alive);
            pii last = *alive.rbegin();
            alive.erase(alive.find(last));
            int x = last.first;
            int color = last.second;
            debug(x, color);
            if (color == RED) {
//                  debug("GB", aliveGreen, aliveBlue);
                  aliveRed.erase(aliveRed.find(x));
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxGreen, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxGreen > maxBlue) {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else if (color == GREEN) {
                  aliveGreen.erase(aliveGreen.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxRed, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxBlue) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else {
                  aliveBlue.erase(aliveBlue.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxi = max(maxRed, maxGreen);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxGreen) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
            }
      }
      cout << area << endl;
      */

      cin >> r >> g >> b;
      for (int i = 1; i <= r; i++) {
            cin >> red[i - 1];
      }
      sort(red, red + r, [&](int p, int q) { return p > q; });
      for (int i = 1; i <= g; i++) {
            cin >> green[i - 1];
      }
      sort(green, green + g, [&](int p, int q) { return p > q; });
      for (int i = 1; i <= b; i++) {
            cin >> blue[i - 1];
      }
      sort(blue, blue + b, [&](int p, int q) { return p > q; });
      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 0;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

void Task() {
      int r, g, b;
      cin >> r >> g >> b;
      multiset <int> aliveRed;
      multiset <int> aliveGreen;
      multiset <int> aliveBlue;
      multiset <pii> alive;
      int RED = 1;
      int GREEN = 2;
      int BLUE = 3;
      for (int i = 1; i <= r; i++) {
            int x;
            cin >> x;
            aliveRed.insert(x);
            alive.insert(mk(x, RED));
      }
      for (int i = 1; i <= g; i++) {
            int x;
            cin >> x;
            aliveGreen.insert(x);
            alive.insert(mk(x, GREEN));
      }
      for (int i = 1; i <= b; i++) {
            int x;
            cin >> x;
            aliveBlue.insert(x);
            alive.insert(mk(x, BLUE));
      }
      int area = 0;
      while (alive.size()) {
            pii last = *alive.rbegin();
            alive.erase(alive.find(last));
            int x = last.first;
            int color = last.second;
            if (color == RED) {
                  aliveRed.erase(aliveRed.find(x));
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxGreen, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxGreen > maxBlue) {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else if (color == GREEN) {
                  aliveGreen.erase(aliveGreen.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxRed, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxBlue) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else {
                  aliveBlue.erase(aliveBlue.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxi = max(maxRed, maxGreen);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxGreen) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
            }
      }
      cout << area << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 1;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
vector <int> red;
vector <int> green;
vector <int> blue;
int dp[201][201][201];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= 200 or gpos >= 200 or bpos >= 200) {
            return 0;
      }
      if (rpos >= r and gpos >= g) {
            return 0;
      }
      if (rpos >= r and bpos >= b) {
            return 0;
      }
      if (gpos >= g and bpos >= b) {
            return 0;
      }
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = solve(rpos + 1, gpos, bpos);
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos));
      MAX(ret, solve(rpos + 1, gpos, bpos + 1));
      MAX(ret, solve(rpos, gpos + 1, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos + 1));
      if (rpos < r) {
            if (gpos < g) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (gpos < g) {
            if (rpos < r) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (bpos < b) {
            if (rpos < r) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
            if (gpos < g) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
//      debug(rpos, gpos, bpos, ret);
      return ret;
}

void Task() {
      /*
      int r, g, b;
      cin >> r >> g >> b;
      multiset <int> aliveRed;
      multiset <int> aliveGreen;
      multiset <int> aliveBlue;
      multiset <pii> alive;
      int RED = 1;
      int GREEN = 2;
      int BLUE = 3;
      for (int i = 1; i <= r; i++) {
            int x;
            cin >> x;
            aliveRed.insert(x);
            alive.insert(mk(x, 1));
      }
      for (int i = 1; i <= g; i++) {
            int x;
            cin >> x;
            aliveGreen.insert(x);
            alive.insert(mk(x, 2));
      }
      for (int i = 1; i <= b; i++) {
            int x;
            cin >> x;
            aliveBlue.insert(x);
            alive.insert(mk(x, 3));
      }
      int area = 0;
      while (alive.size()) {
            debug(alive);
            pii last = *alive.rbegin();
            alive.erase(alive.find(last));
            int x = last.first;
            int color = last.second;
            debug(x, color);
            if (color == RED) {
//                  debug("GB", aliveGreen, aliveBlue);
                  aliveRed.erase(aliveRed.find(x));
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxGreen, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxGreen > maxBlue) {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else if (color == GREEN) {
                  aliveGreen.erase(aliveGreen.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxRed, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxBlue) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else {
                  aliveBlue.erase(aliveBlue.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxi = max(maxRed, maxGreen);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxGreen) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
            }
      }
      cout << area << endl;
      */

      cin >> r >> g >> b;
      for (int i = 1; i <= r; i++) {
            int x;
            cin >> x;
            red.push_back(x);
      }
      for (int i = 1; i <= g; i++) {
            int x;
            cin >> x;
            green.push_back(x);
      }
      for (int i = 1; i <= b; i++) {
            int x;
            cin >> x;
            blue.push_back(x);
      }
      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 0;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
int red[201];
int green[201];
int blue[201];
int dp[201][201][201];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= 200 or gpos >= 200 or bpos >= 200) {
            return 0;
      }
      /*
      if (rpos >= r and gpos >= g) {
            return 0;
      }
      if (rpos >= r and bpos >= b) {
            return 0;
      }
      if (gpos >= g and bpos >= b) {
            return 0;
      }
      */
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = solve(rpos + 1, gpos, bpos);
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos));
      MAX(ret, solve(rpos + 1, gpos, bpos + 1));
      MAX(ret, solve(rpos, gpos + 1, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos + 1));
      {
            int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
            MAX(ret, go);
      }
      {
            int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
            MAX(ret, go);
      }
      {
            int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
            MAX(ret, go);
      }
      /*
      if (rpos < r) {
            if (gpos < g) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (gpos < g) {
            if (rpos < r) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (bpos < b) {
            if (rpos < r) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
            if (gpos < g) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      */
//      debug(rpos, gpos, bpos, ret);
      return ret;
}

void Task() {
      /*
      int r, g, b;
      cin >> r >> g >> b;
      multiset <int> aliveRed;
      multiset <int> aliveGreen;
      multiset <int> aliveBlue;
      multiset <pii> alive;
      int RED = 1;
      int GREEN = 2;
      int BLUE = 3;
      for (int i = 1; i <= r; i++) {
            int x;
            cin >> x;
            aliveRed.insert(x);
            alive.insert(mk(x, 1));
      }
      for (int i = 1; i <= g; i++) {
            int x;
            cin >> x;
            aliveGreen.insert(x);
            alive.insert(mk(x, 2));
      }
      for (int i = 1; i <= b; i++) {
            int x;
            cin >> x;
            aliveBlue.insert(x);
            alive.insert(mk(x, 3));
      }
      int area = 0;
      while (alive.size()) {
            debug(alive);
            pii last = *alive.rbegin();
            alive.erase(alive.find(last));
            int x = last.first;
            int color = last.second;
            debug(x, color);
            if (color == RED) {
//                  debug("GB", aliveGreen, aliveBlue);
                  aliveRed.erase(aliveRed.find(x));
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxGreen, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxGreen > maxBlue) {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else if (color == GREEN) {
                  aliveGreen.erase(aliveGreen.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxBlue = 0;
                  if (sz(aliveBlue)) {
                        maxBlue = *aliveBlue.rbegin();
                  }
                  int maxi = max(maxRed, maxBlue);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxBlue) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxBlue;
                        aliveBlue.erase(aliveBlue.find(maxBlue));
                        alive.erase(alive.find(mk(maxBlue, BLUE)));
                  }
            }
            else {
                  aliveBlue.erase(aliveBlue.find(x));
                  int maxRed = 0;
                  if (sz(aliveRed)) {
                        maxRed = *aliveRed.rbegin();
                  }
                  int maxGreen = 0;
                  if (sz(aliveGreen)) {
                        maxGreen = *aliveGreen.rbegin();
                  }
                  int maxi = max(maxRed, maxGreen);
                  if (maxi == 0) {
                        continue;
                  }
                  if (maxRed > maxGreen) {
                        area += x * maxRed;
                        aliveRed.erase(aliveRed.find(maxRed));
                        alive.erase(alive.find(mk(maxRed, RED)));
                  }
                  else {
                        area += x * maxGreen;
                        aliveGreen.erase(aliveGreen.find(maxGreen));
                        alive.erase(alive.find(mk(maxGreen, GREEN)));
                  }
            }
      }
      cout << area << endl;
      */

      cin >> r >> g >> b;
      for (int i = 1; i <= r; i++) {
            cin >> red[i - 1];
      }
      for (int i = 1; i <= g; i++) {
            cin >> green[i - 1];
      }
      for (int i = 1; i <= b; i++) {
            cin >> blue[i - 1];
      }
      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 0;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
int red[201];
int green[201];
int blue[201];
int dp[201][201][201];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= 200 or gpos >= 200 or bpos >= 200) {
            return 0;
      }
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = solve(rpos + 1, gpos, bpos);
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos));
      MAX(ret, solve(rpos + 1, gpos, bpos + 1));
      MAX(ret, solve(rpos, gpos + 1, bpos + 1));
      MAX(ret, solve(rpos + 1, gpos + 1, bpos + 1));
      if (rpos < r) {
            if (gpos < g) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (gpos < g) {
            if (rpos < r) {
                  int go = red[rpos] * green[gpos] + solve(rpos + 1, gpos + 1, bpos);
                  MAX(ret, go);
            }
            if (bpos < b) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
      if (bpos < b) {
            if (rpos < r) {
                  int go = red[rpos] * blue[bpos] + solve(rpos + 1, gpos, bpos + 1);
                  MAX(ret, go);
            }
            if (gpos < g) {
                  int go = green[gpos] * blue[bpos] + solve(rpos, gpos + 1, bpos + 1);
                  MAX(ret, go);
            }
      }
//      debug(rpos, gpos, bpos, ret);
      return ret;
}

void Task() {

      cin >> r >> g >> b;
      for (int i = 1; i <= r; i++) {
            cin >> red[i - 1];
      }
      sort(red, red + r, [&](int p, int q) { return p > q; });
      for (int i = 1; i <= g; i++) {
            cin >> green[i - 1];
      }
      sort(green, green + g, [&](int p, int q) { return p > q; });
      for (int i = 1; i <= b; i++) {
            cin >> blue[i - 1];
      }
      sort(blue, blue + b, [&](int p, int q) { return p > q; });
      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 0;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
int red[201];
int green[201];
int blue[201];
int dp[205][205][205];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= r or gpos >= g or bpos >= b) {
            return 0;
      }
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = 0;
      MAX(ret, solve(rpos + 1, gpos, bpos));
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      {
            int go = (red[rpos] * green[gpos]) + solve(rpos + 1, gpos + 1, bpos);
            MAX(ret, go);
      }
      {
            int go = (red[rpos] * blue[bpos]) + solve(rpos + 1, gpos, bpos + 1);
            MAX(ret, go);
      }
      {
            int go = (green[gpos] * blue[bpos]) + solve(rpos, gpos + 1, bpos + 1);
            MAX(ret, go);
      }
      return ret;
}

void Task() {

      cin >> r >> g >> b;
      for (int i = 0; i < 201; i++) {
            red[i] = green[i] = blue[i] = 0;
      }
      for (int i = 1; i <= r; i++) {
            cin >> red[i - 1];
      }
      sort(red, red + r, [&](int p, int q) { return p > q; });

      for (int i = 1; i <= g; i++) {
            cin >> green[i - 1];
      }
      sort(green, green + g, [&](int p, int q) { return p > q; });

      for (int i = 1; i <= b; i++) {
            cin >> blue[i - 1];
      }
      sort(blue, blue + b, [&](int p, int q) { return p > q; });

      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 1;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#undef _GLIBCXX_DEBUG

#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

void trace(int x)                         { cerr << x; }
void trace(long x)                        { cerr << x; }
void trace(long long x)                   { cerr << x; }
void trace(unsigned x)                    { cerr << x; }
void trace(unsigned long x)               { cerr << x; }
void trace(unsigned long long x)          { cerr << x; }
void trace(float x)                       { cerr << x; }
void trace(double x)                      { cerr << x; }
void trace(long double x)                 { cerr << x; }
void trace(char x)                        { cerr << '\'' << x << '\''; }
void trace(const char *x)                 { cerr << '\"' << x << '\"'; }
void trace(const string &x)               { cerr << '\"' << x << '\"'; }
void trace(bool x)                        { cerr << (x ? "true" : "false"); }

template <typename A, typename B>                         void trace(const pair <A, B> &x)         { cerr << '{'; trace(x.first); cerr << ','; trace(x.second); cerr << '}'; }
template <typename A, typename B, typename C>             void trace(const tuple <A, B, C> &x)     { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << '}'; }
template <typename A, typename B, typename C, typename D> void trace(const tuple <A, B, C, D> &x)  { cerr << '{'; trace(get <0> (x)); cerr << ','; trace(get <1> (x)); cerr << ','; trace(get <2> (x)); cerr << ','; trace(get <3> (x)); cerr << '}'; }
template <typename T>                                     void trace(const T &x)                   { int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), trace(i); cerr << "}"; }
template <size_t N>                                       void trace(bitset <N> v)                 { cerr << '{'; for (size_t i = 0; i < N; i++) cerr << static_cast <char> ('0' + v[i]); cerr << '}'; }
void _print()                                                                                { cerr << "]\n"; }
template <typename T, typename... V>                      void _print(T t, V... v)                 { trace(t); if (sizeof...(v)) cerr << ", "; _print(v...); }

#ifndef ONLINE_JUDGE
      #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
      #define debug(x...)
#endif // ONLINE_JUDGE

template <typename T> using ordered_set                = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T1, typename T2> using ordered_map  = tree <T1, T2, less <T1>, rb_tree_tag, tree_order_statistics_node_update>;

template <class T> T binaryExpo(T a, T p)              { if (p == 0) { return 1LL; } if (p == 1) { return a; } if (p & 1) { return a * binaryExpo(a, p - 1); } T ret = binaryExpo(a, p / 2); return ret * ret; }
template <class T> T bigMod(T a, T p, T m)             { if (p == 0) { return 1LL % m; } if (p == 1) { return a % m; } if (p & 1) { return (a % m * bigMod(a, p - 1, m)) % m; } T ret = bigMod(a, p / 2, m) % m; return (ret * ret) % m; }
template <class T> T modInv(T a, T m)                  { return bigMod(a, m - 2, m); }

template <class T> bool MIN(T &a, T b)                 { return a > b ? (a = b, true) : false; }
template <class T> bool MAX(T &a, T b)                 { return a < b ? (a = b, true) : false; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define ll              long long int
#define ull             unsigned long long int
#define ld              long double
#define endl            '\n'
#define pii             pair <int, int>
#define pll             pair <ll, ll>
#define mk              make_pair
#define ff              first
#define ss              second
#define all(a)          (a).begin(), (a).end()
#define rall(a)         (a).rbegin(), (a).rend()
#define eb              emplace_back
#define pb              push_back
#define pf              push_front
#define sz(a)           (int)(a.size())
#define ook             order_of_key             // The number of items in a set that are strictly smaller than k
#define fbo             find_by_order            // It returns an iterator to the i'th largest element
#define ATCODER         if (fopen("in.txt", "r")) { freopen("in.txt", "r", stdin); }

#define int             long long int

const int maxn = 3e5 + 5;
const int logn = 19;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;

int r;
int g;
int b;
int red[201];
int green[201];
int blue[201];
int dp[205][205][205];

int solve(int rpos, int gpos, int bpos) {
      if (rpos >= 200 or gpos >= 200 or bpos >= 200) {
            return 0;
      }
      int &ret = dp[rpos][gpos][bpos];
      if (~ret) {
            return ret;
      }
      ret = 0;
      MAX(ret, solve(rpos + 1, gpos, bpos));
      MAX(ret, solve(rpos, gpos + 1, bpos));
      MAX(ret, solve(rpos, gpos, bpos + 1));
      {
            int go = (red[rpos] * green[gpos]) + solve(rpos + 1, gpos + 1, bpos);
            MAX(ret, go);
      }
      {
            int go = (red[rpos] * blue[bpos]) + solve(rpos + 1, gpos, bpos + 1);
            MAX(ret, go);
      }
      {
            int go = (green[gpos] * blue[bpos]) + solve(rpos, gpos + 1, bpos + 1);
            MAX(ret, go);
      }
      return ret;
}

void Task() {

      cin >> r >> g >> b;
      for (int i = 0; i < 201; i++) {
            red[i] = green[i] = blue[i] = 0;
      }
      for (int i = 1; i <= r; i++) {
            cin >> red[i - 1];
      }
      sort(red, red + r, [&](int p, int q) { return p > q; });

      for (int i = 1; i <= g; i++) {
            cin >> green[i - 1];
      }
      sort(green, green + g, [&](int p, int q) { return p > q; });

      for (int i = 1; i <= b; i++) {
            cin >> blue[i - 1];
      }
      sort(blue, blue + b, [&](int p, int q) { return p > q; });

      memset(dp, -1, sizeof dp);
      cout << solve(0, 0, 0) << endl;
}

signed main()
{
      ios_base::sync_with_stdio(false);
      cin.tie(nullptr); cout.tie(nullptr);
      cout.precision(12);

      bool FILEIO = 1;
      if (FILEIO and fopen("in.txt", "r")) {
            freopen("in.txt", "r", stdin);
      }

      int tc = 1;
      while (tc--) {
            Task();
      }

      #ifndef ONLINE_JUDGE
            cerr << endl << "Time : " << 1.0 * clock() / CLOCKS_PER_SEC << " s." << endl;
      #endif // ONLINE_JUDGE
}


#include<stdio.h>
#include<bits/stdc++.h>
int main()
{
    int r,g,b;
    cin>>R>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int r,g,b,i,j,k;
    cin>>r>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
using namespce std;
int main()
{
    int r,g,b,i,j,k;
    cin>>r>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
int main
{
    int r,g,b;
    cin>>r>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
int main
{
    int r,g,b;
    cin>>R>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
int main
{
    int r,g,b,i,j,k;
    cin>>R>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
int main
{
    int r,g,b;
    cin>>R>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio.h>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int r,g,b,i,j,k;
    cin>>r>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G,g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<stdio>
#include<bits/stdc++.h>
int main
{
    int r,g,b;
    cin>>R>>g>>b;
    int R[r],G[g],B[b];
    int f[r][g][b];
    for(int i=0;i<r;i++)
    cin>>R[i];
     for(int j=0;j<g;j++)
    cin>>G[j];
     for(int k=0;k<b;k++)
    cin>>B[k];
    sort(R,r+R);
    sort(G<g+G);
    sort(B,B+b);
    int res=0;
    for(i=r;i>=0;i--)
    for(j=g;j>=0;j--)
    for(k=0;k<=b;k++)
    {
    f[i-1][j-1][k-1]=max(f[i][j][k-1]+R[i]*G[j],max(f[i][j-1][k]+R[i]*B[k],max(f[i-1][j][k]+G[j]*B[k],0) ));
     res=max(res,f[i][j][k]);

    }
    cout<<res;
    return 0;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;

    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<=r;i++)
    {
        for(j=0;j<=g;j++)
        {
            for(k=0;k<=b;k++)
                dp[i][j][k]=-1;
        }
    }

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
vector<vector<vector<ll> > >v0;
ll bul(ll i,ll j,ll k,ll n1,ll n2,ll n3,vec v1,vec v2,vec v3)
{
    ll c1=0;
    if(i>=n1)
        {
            c1++;
            i=n1;
        }
      if(j>=n2)
        {
            c1++;
            j=n2;
        }
        if(k>=n3)
        {
            c1++;
            k=n3;
        }
        if(c1>=2)
            return 0;
    if(v0[i][j][k]>0)
        return v0[i][j][k];
    ll a,b,c;
    a=-1;
    b=-1;
    c=-1;
    if(i<n1)
    {
       a=v1[i];
    }
    if(j<n2)
    {
       b=v2[j];
    }
    if(k<n3)
    {
       c=v3[k];
    }
    if(a*b*c<0)
        {
           if(c==-1)
            return v0[i][j][k]=(a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3) );
           if(a==-1)
            return v0[i][j][k]=(c*b+bul(i,j+1,k+1,n1,n2,n3,v1,v2,v3) );
            if(b==-1)
            return v0[i][j][k]=(a*c+bul(i+1,j,k+1,n1,n2,n3,v1,v2,v3) );
        }
    if((a==b)&&(b==c))
    {
        ll p,q,r;
        p=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        q=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        r=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
        ll s=max(max(p,q),r);
        if(s==p)
            return v0[i][j][k]=p;
        if(s==q)
            return v0[i][j][k]=q;
        return v0[i][j][k]=r;
    }
    ll p,q,r;
    p=a*b;
    q=c*b;
    r=a*c;
    ll s=max(max(p,q),r);
    if(s==p)
    {
        return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
    }
    if(s==q)
            return v0[i][j][k]=c*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
    return v0[i][j][k]=a*c+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec q1;
    vec q2;
    vec q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.pb(j);
    }
    for(i=0;i<r+1;i++)
    {
        vector<vector<ll> >tem;
        for(j=0;j<b+1;j++)
        {
            vec z(g+1,0);
            tem.pb(z);
        }
        v0.pb(tem);
    }
    sort(q1.rbegin(),q1.rend());
    sort(q2.rbegin(),q2.rend());
    sort(q3.rbegin(),q3.rend());
    k=bul(0,0,0,r,g,b,q1,q2,q3);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    priority_queue<ll> q1;
    priority_queue<ll> q2;
    priority_queue<ll> q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.push(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.push(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.push(j);
    }
    ll c1=0;
    ll sum=0;
    while(c1<2)
    {
        c1=0;
        i=-1;
        j=-1;
        k=-1;
        if(q1.size()!=0)
        {
            i=q1.top();
        }
        if(q2.size()!=0)
        {
            j=q2.top();
        }
        if(q3.size()!=0)
        {
            k=q3.top();
        }
      vec v1;
      v1.pb(i);
      v1.pb(j);
      v1.pb(k);
    sort(v1.rbegin(),v1.rend());
      if((i==v1[0])||(i==v1[1]))
        q1.pop();
      if((j==v1[0])||(j==v1[1]))
        q2.pop();
        if((k==v1[0])||(k==v1[1]))
        q3.pop();

       if(q1.size()==0)
        c1++;
       if(q2.size()==0)
        c1++;
        if(q3.size()==0)
        c1++;
       sum=sum+v1[0]*v1[1];
    }
  cout<<sum<<"\n";

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[202][202][202];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n) && (j<n))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n);
    if((j<n) && (k<n))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n);
    if((i<n) && (k<n))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    n++;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            for(k=0;k<n;k++)
                dp[i][j][k]=-1;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
vector<vector<vector<ll> > >v0;
ll bul(ll i,ll j,ll k,ll n1,ll n2,ll n3,vec v1,vec v2,vec v3)
{
    ll c1=0;
    if(i>=n1)
        {
            c1++;
            i=n1;
        }
      if(j>=n2)
        {
            c1++;
            j=n2;
        }
        if(k>=n3)
        {
            c1++;
            k=n3;
        }
        if(c1>=2)
            return 0;
    if(v0[i][j][k]>0)
        return v0[i][j][k];
    ll a,b,c;
    a=-1;
    b=-1;
    c=-1;
    if(i<n1)
    {
       a=v1[i];
    }
    if(j<n2)
    {
       b=v2[j];
    }
    if(k<n3)
    {
       c=v3[k];
    }
    if(a*b*c<0)
        {
           if(c==-1)
            return v0[i][j][k]=(a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3) );
           if(a==-1)
            return v0[i][j][k]=(c*b+bul(i,j+1,k+1,n1,n2,n3,v1,v2,v3) );
            if(b==-1)
            return v0[i][j][k]=(a*c+bul(i+1,j,k+1,n1,n2,n3,v1,v2,v3) );
        }
    if((a==b)&&(b==c))
    {
        ll p,q,r;
        p=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        q=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        r=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
        ll s=max(max(p,q),r);
        if(s==p)
            return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        if(s==q)
            return v0[i][j][k]=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        return v0[i][j][k]=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
    }
    ll p,q,r;
    p=a*b;
    q=c*b;
    r=a*c;
    ll s=max(max(p,q),r);
    if(s==p)
    {
        return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
    }
    if(s==q)
            return v0[i][j][k]=c*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
    return v0[i][j][k]=a*c+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec q1;
    vec q2;
    vec q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.pb(j);
    }
    for(i=0;i<r+1;i++)
    {
        vector<vector<ll> >tem;
        for(j=0;j<b+1;j++)
        {
            vec z(g+1,0);
            tem.pb(z);
        }
        v0.pb(tem);
    }
    sort(q1.rbegin(),q1.rend());
    sort(q2.rbegin(),q2.rend());
    sort(q3.rbegin(),q3.rend());
    k=bul(0,0,0,r,g,b,q1,q2,q3);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
vector<vector<vector<ll> > >v0;
ll bul(ll i,ll j,ll k,ll n1,ll n2,ll n3,vec v1,vec v2,vec v3)
{
    ll c1=0;
    if(i>=n1)
        {
            c1++;
            i=n1;
        }
      if(j>=n2)
        {
            c1++;
            j=n2;
        }
        if(k>=n3)
        {
            c1++;
            k=n3;
        }
        if(c1>=2)
            return 0;
    if(v0[i][j][k]>0)
        return v0[i][j][k];
    ll a,b,c;
    a=-1;
    b=-1;
    c=-1;
    if(i<n1)
    {
       a=v1[i];
    }
    if(j<n2)
    {
       b=v2[j];
    }
    if(k<n3)
    {
       c=v3[k];
    }
    if(a*b*c<0)
        {
           if(c==-1)
            return v0[i][j][k]=(a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3) );
           if(a==-1)
            return v0[i][j][k]=(c*b+bul(i,j+1,k+1,n1,n2,n3,v1,v2,v3) );
            if(b==-1)
            return v0[i][j][k]=(a*c+bul(i+1,j,k+1,n1,n2,n3,v1,v2,v3) );
        }
    if((a==b)&&(b==c))
    {
        ll p,q,r;
        p=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        q=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        r=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
        ll s=max(max(p,q),r);
        if(s==p)
            return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        if(s==q)
            return v0[i][j][k]=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        return v0[i][j][k]=r+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
    }
    ll p,q,r;
    p=a*b;
    q=c*b;
    r=a*c;
    ll s=max(max(p,q),r);
    if(s==p)
    {
        return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
    }
    if(s==q)
            return v0[i][j][k]=c*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
    return v0[i][j][k]=a*c+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec q1;
    vec q2;
    vec q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.pb(j);
    }
    for(i=0;i<r+1;i++)
    {
        vector<vector<ll> >tem;
        for(j=0;j<b+1;j++)
        {
            vec z(g+1,0);
            tem.pb(z);
        }
        v0.pb(tem);
    }
    sort(q1.rbegin(),q1.rend());
    sort(q2.rbegin(),q2.rend());
    sort(q3.rbegin(),q3.rend());
    k=bul(0,0,0,r,g,b,q1,q2,q3);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    p=-1;
    q=-1;
    r=-1;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    if(p+q+r==-3)
        return dp[i][j][k]=0;
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<=r;i++)
    {
        for(j=0;j<=g;j++)
        {
            for(k=0;k<=b;k++)
                dp[i][j][k]=-1;
        }
    }

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    p=-1;
    q=-1;
    r=-1;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    if(p+q+r==-3)
        return dp[i][j][k]=0;
    else
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<r;i++)
    {
        for(j=0;j<g;j++)
        {
            for(k=0;k<b;k++)
                dp[i][j][k]=-1;
        }
    }

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    priority_queue<ll> q1;
    priority_queue<ll> q2;
    priority_queue<ll> q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.push(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.push(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.push(j);
    }
    ll c1=0;
    ll sum=0;
    while(c1<2)
    {
        i=-1;
        j=-1;
        k=-1;
        if(q1.size()!=0)
        {
            i=q1.top();
        }
        if(q2.size()!=0)
        {
            j=q2.top();
        }
        if(q3.size()!=0)
        {
            k=q3.top();
        }
      vec v1;
      v1.pb(i);
      v1.pb(j);
      v1.pb(k);
    sort(v1.rbegin(),v1.rend());
      if((i==v1[0])||(i==v1[1]))
        q1.pop();
      if((j==v1[0])||(j==v1[1]))
        q2.pop();
        if((k==v1[0])||(k==v1[1]))
        q3.pop();
       if(q1.size()==0)
        c1++;
       if(q2.size()==0)
        c1++;
        if(q3.size()==0)
        c1++;
       sum=sum+v1[0]*v1[1];
    }
  cout<<sum<<"\n";

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[201][201][201];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    if((i>=n)||(j>=n)||(k>=n))
        return 0;
    if(dp[i][j][k]!=0)
        return dp[i][j][k];

    vec v;
    v.pb(v1[i]);
    v.pb(v2[j]);
    v.pb(v3[k]);
    sort(v.rbegin(),v.rend());
    if((v[0]!=v[1])&&(v[1]!=v[2]))
    {
       ll a=0,b=0,c=0;
        if(v[0]==v1[i])
            a=1;
        else if(v[0]==v2[j])
            b=1;
        else
            c=1;
        if(v[1]==v1[i])
            a=1;
        else if(v[1]==v2[j])
            b=1;
        else
            c=1;
        return dp[i][j][k]=v[0]*v[1]+tem(v1,v2,v3,i+a,j+b,k+c,n);

    }
    if((v[0]==v[1])&&(v[1]==v[2]))
    {
       ll a,b,c;
            a=v[0]*v[1]+tem(v1,v2,v3,i+1,j+1,k,n);
            b=v[0]*v[1]+tem(v1,v2,v3,i+1,j,k+1,n);
            c=v[0]*v[1]+tem(v1,v2,v3,i,j+1,1+k,n);
      return dp[i][j][k]=max(max(a,b),c);
    }
    if(v[0]==v[1])
    {
        if(v1[i]==v2[j])
            return dp[i][j][k]=v[0]*v[1]+tem(v1,v2,v3,i+1,j+1,k,n);

        if(v1[i]==v3[k])
            return dp[i][j][k]=v[0]*v[1]+tem(v1,v2,v3,i+1,j,k+1,n);

        if(v3[k]==v2[j])
            return dp[i][j][k]=v[0]*v[1]+tem(v1,v2,v3,i,j+1,k+1,n);

    }
    if(v[1]==v[2])
    {

        if(v1[i]==v2[j])
            return dp[i][j][k]=v[0]*v[1]+max(tem(v1,v2,v3,i+1,j,k+1,n),tem(v1,v2,v3,i,j+1,k+1,n));
        if(v3[k]==v2[j])
            return dp[i][j][k]=v[0]*v[1]+max(tem(v1,v2,v3,i+1,j,k+1,n),tem(v1,v2,v3,1+i,j+1,k,n));
        if(v1[i]==v3[k])
            return dp[i][j][k]=v[0]*v[1]+max(tem(v1,v2,v3,i+1,j+1,k,n),tem(v1,v2,v3,i,j+1,k+1,n));
    }
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    n++;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            for(k=0;k<n;k++)
                dp[i][j][k]=0;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
using namespace std;
vector<vector<vector<ll> > >v0;
ll bul(ll i,ll j,ll k,ll n1,ll n2,ll n3,vec v1,vec v2,vec v3)
{
    ll c1=0;
    if(i>=n1)
        {
            c1++;
            i=n1;
        }
      if(j>=n2)
        {
            c1++;
            j=n2;
        }
        if(k>=n3)
        {
            c1++;
            k=n3;
        }
        if(c1>=2)
            return 0;
    if(v0[i][j][k]>0)
        return v0[i][j][k];
    ll a,b,c;
    a=-1;
    b=-1;
    c=-1;
    if(i<n1)
    {
       a=v1[i];
    }
    if(j<n2)
    {
       b=v2[j];
    }
    if(k<n3)
    {
       c=v3[k];
    }
    if(a*b*c<0)
        {
           if(c==-1)
            return v0[i][j][k]=(a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3) );
           if(a==-1)
            return v0[i][j][k]=(c*b+bul(i,j+1,k+1,n1,n2,n3,v1,v2,v3) );
            if(b==-1)
            return v0[i][j][k]=(a*c+bul(i+1,j,k+1,n1,n2,n3,v1,v2,v3) );
        }
    if((a==b)&&(b==c))
    {
        ll p,q,r;
        p=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
        q=a*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
        r=a*b+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
        ll s=max(max(p,q),r);
        if(s==p)
            return v0[i][j][k]=p;
        if(s==q)
            return v0[i][j][k]=q;
        return v0[i][j][k]=r;
    }
    ll p,q,r;
    p=a*b;
    q=c*b;
    r=a*c;
    ll s=max(max(p,q),r);
    if(s==p)
    {
        return v0[i][j][k]=a*b+bul(i+1,j+1,k,n1,n2,n3,v1,v2,v3);
    }
    if(s==q)
            return v0[i][j][k]=c*b+bul(i,j+1,1+k,n1,n2,n3,v1,v2,v3);
    return v0[i][j][k]=a*c+bul(i+1,j,1+k,n1,n2,n3,v1,v2,v3);
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec q1;
    vec q2;
    vec q3;
    for(i=0;i<r;i++)
    {
        cin>>j;
        q1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        q2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        q3.pb(j);
    }
    for(i=0;i<r+10;i++)
    {
        vector<vector<ll> >tem;
        for(j=0;j<b+10;j++)
        {
            vec z(g+10,0);
            tem.pb(z);
        }
        v0.pb(tem);
    }
    sort(q1.rbegin(),q1.rend());
    sort(q2.rbegin(),q2.rend());
    sort(q3.rbegin(),q3.rend());
    k=bul(0,0,0,r,g,b,q1,q2,q3);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[201][201][201];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n)
{
    ll p,q,r;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n) && (j<n))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n);
    if((j<n) && (k<n))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n);
    if((i<n) && (k<n))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n);
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll n=max(max(r,g),b);
    n++;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }
    for(i=v1.size();i<n;i++)
        v1.pb(0);

    for(i=v2.size();i<n;i++)
        v2.pb(0);

    for(i=0;i<n;i++)
    {
        for(j=0;j<n;j++)
        {
            for(k=0;k<n;k++)
                dp[i][j][k]=-1;
        }
    }
    for(i=v3.size();i<n;i++)
        v3.pb(0);

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,n);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec v1,vec v2,vec v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    p=-1;
    q=-1;
    r=-1;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    if(p+q+r==-3)
        return dp[i][j][k]=0;
    else
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<203;i++)
    {
        for(j=0;j<203;j++)
        {
            for(k=0;k<203;k++)
                dp[i][j][k]=-1;
        }
    }
    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include<bits/stdc++.h>
#define ll long long int
#define fin for(i=0;i<n;i++)
#define vec vector<ll>
#define pb push_back
#define vecit vector<ll>::iterator
#define vecp vector<pair<ll,ll> >
#define vecpit vector<pair<ll,ll> >::iterator
#define mapp map<ll,ll>
#define mapr map<ll,pair<ll,ll> >
#define maprit map<ll,pair<ll,ll> >::iterator
#define mapit map<ll,ll>::iterator
#define mod1 1000000007
#define INF 1000000000000000000
#define twodp vector<vector<ll> >dp(n+1,vec (k+1,0));
using namespace std;
ll dp[203][203][203];
ll tem(vec &v1,vec &v2,vec &v3,ll i,ll j,ll k,ll n1,ll n2,ll n3)
{
    ll p,q,r;
    p=-1;
    q=-1;
    r=-1;
    if(dp[i][j][k]!=-1)
    return dp[i][j][k];
    if((i<n1) && (j<n2))
        p=v1[i]*v2[j]+tem(v1,v2,v3,i+1,j+1,k,n1,n2,n3);
    if((j<n2) && (k<n3))
        q=v2[j]*v3[k]+tem(v1,v2,v3,i,j+1,k+1,n1,n2,n3);
    if((i<n1) && (k<n3))
        r=v1[i]*v3[k]+tem(v1,v2,v3,i+1,j,1+k,n1,n2,n3);
    if(p+q+r==-3)
        return dp[i][j][k]=0;
    else
    return (dp[i][j][k]=max(max(p,q),r));
}
int main()
{
    ll r,g,b;
    cin>>r>>g>>b;
    ll i,j,k,l;
    vec v1;
    vec v2;
    vec v3;
    for(i=0;i<r;i++)
    {
       cin>>j;
       v1.pb(j);
    }
    for(i=0;i<g;i++)
    {
        cin>>j;
        v2.pb(j);
    }
    for(i=0;i<b;i++)
    {
        cin>>j;
        v3.pb(j);
    }

    for(i=0;i<203;i++)
    {
        for(j=0;j<203;j++)
        {
            for(k=0;k<203;k++)
                dp[i][j][k]=-1;
        }
    }

    sort(v1.rbegin(),v1.rend());
    sort(v2.rbegin(),v2.rend());
    sort(v3.rbegin(),v3.rend());

    k=tem(v1,v2,v3,0,0,0,r,g,b);
    cout<<k;

}


#include <bits/stdc++.h>
#define ll long long int
#define vec vector<ll>
#define vecp vector<pair<ll,ll> >
#define mapp map<ll,ll>
#define mapit map<ll,ll>::iterator
#define mapr map<pair<ll,ll>,ll>
#define maprit map<pair<ll,ll>,ll>::iterator
#define fs first
#define sc second
#define bg begin()
#define en end()
#define pb push_back
#define fin for(i=0;i<n;i++)
#define mod1 1000000007
#define INF 10000000000000000000
#define twodp vector<vec >dp(n+1,vec(k+1,0))
using namespace std;
ll gcd(ll a,ll b)
{
  if(a==0 || b==0)
    return a+b;
  else
    return __gcd(a,b);
}
int main()
{
     ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

	ll t;
	cin>>t;
	while(t--)
	{
		ll n;
		cin>>n;
		ll i,j,k=0,l;
		ll a[n];
		fin
		{
			cin>>j;
			a[i]=j;
           k+=j;
		}
          if(k<0)
          {
          	cout<<"NO\n";
          	continue;
          }
		 l=0;ll p=0;ll q=0;ll ind=0;
		for(i=0;i<n;i++)
		{
           l=max(0*1LL,l+a[i]);
           if(l>q)
           {
           	q=l;
           	ind=i;
           }

             if(l==0)
             	p=1;
		}
		if(ind==n-1 && q==k && p!=1)
		{
			cout<<"YES\n";
			continue;
		}
		if(ind!=n-1 && q==k)
		{
			cout<<"NO\n";
			continue;
		}
		if(q<k)
			cout<<"YES\n";
		else
			cout<<"NO\n";

	}
	return 0;
}