#include<bits/stdc++.h>
using namespace std;
using ll = long long;

// #undef DEBUG
// #define DEBUG
/// {{{ DEBUG --- ///
template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { if(&o == &cerr) { o << '{'; for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? ", " : ""); o << "}"; } else { for(size_t i = 0; i < v.size(); i++) o << v[i] << (i + 1 != v.size() ? " " : ""); } return o; }
#ifdef DEBUG
#ifdef USE_COUT
#define dump(...) (cout<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n")
#else
#define dump(...) (cerr<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n")
#endif
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream &o, tuple<T...> const &t){ o << "("; _ot<0>(o, t); o << ")"; return o; }
template<class T, class U> ostream & operator<<(ostream &o, pair<T, U> const &p) { o << "(" << p.first << ", " << p.second << ")"; return o; }
#else
#define dump(...) (0)
#endif
/// }}}--- ///

const int N = 1e5;
ll a[3][N];
int x[3], n;
ll dp[300][300][300];
ll pre[300][300][300];
vector<int> best;
ll solve(int X, int Y, int Z) {
  using Q = pair<int, int>;
  if(dp[X][Y][Z]) return dp[X][Y][Z];
  auto q = max({
      Q(X ? solve(X-1,Y,Z)+a[0][X+Y+Z-1] : 0, 0),
      Q(Y ? solve(X,Y-1,Z)+a[1][X+Y+Z-1] : 0, 1),
      Q(Z ? solve(X,Y,Z-1)+a[2][X+Y+Z-1] : 0, 2),
      });
  pre[X][Y][Z] = q.second;
  return dp[X][Y][Z] = q.first;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> x[0] >> x[1] >> x[2];
  n = x[0] + x[1] + x[2];
  for(int i = 0; i < n; i++) for(int j = 0; j < 3; j++) cin >> a[j][i];

  // best.resize(n);
  // cout << "a:" << solve(x[0], x[1], x[2]) << endl;
  // for(int X = x[0], Y = x[1], Z = x[2]; X + Y + Z >= 1; tie(X,Y,Z) = make_tuple(X - (pre[X][Y][Z] == 0), Y - (pre[X][Y][Z] == 1), Z - (pre[X][Y][Z] == 2))) {
  //   best[X+Y+Z-1] = pre[X][Y][Z];
  // }
  // cout << "a:" << solve(0, 0, 0) << endl;
  // dump(best);

  using P = tuple<ll, int>;
  priority_queue<P> A[3][3];
  ll ans = 0;
  vector<int> ass(n);
  for(int i = 0; i < x[0]; i++) ans += a[0][i],
    A[0][1].emplace(a[1][i] - a[0][i], i), A[0][2].emplace(a[2][i] - a[0][i], i);
  for(int i = x[0]; i < x[0] + x[1]; i++) ans += a[1][i], ass[i] = 1,
    A[1][0].emplace(a[0][i] - a[1][i], i), A[1][2].emplace(a[2][i] - a[1][i], i);
  for(int i = x[0] + x[1]; i < n; i++) ans += a[2][i], ass[i] = 2,
    A[2][0].emplace(a[0][i] - a[2][i], i), A[2][1].emplace(a[1][i] - a[2][i], i);
  int update = 1;
  while(update) {
    update = 0;
    for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) if(i < j) {
      while(1) {
        ll vi, vj; int ii, ij;
        tie(vi, ii) = A[i][j].top();
        tie(vj, ij) = A[j][i].top();
        if(i != ass[ii]) { A[i][j].pop(); continue; }
        if(j != ass[ij]) { A[j][i].pop(); continue; }
        ll nv = vi + vj;
        if(nv > 0) {
          ans += nv;
          A[i][j].pop(); A[j][i].pop();
          A[i][(i + 1) % 3].emplace(a[(i + 1) % 3][ij] - a[i][ij], ij);
          A[i][(i + 2) % 3].emplace(a[(i + 2) % 3][ij] - a[i][ij], ij);
          A[j][(j + 1) % 3].emplace(a[(j + 1) % 3][ii] - a[j][ii], ii);
          A[j][(j + 2) % 3].emplace(a[(j + 2) % 3][ii] - a[j][ii], ii);
          ass[ij] = i; ass[ii] = j;
          update = 1;
        }
        break;
      }
    }
    int i = 0, j = 1, k = 2;
    for(int _ = 0; _ < 2; _++) {
      while(1) {
        ll vi, vj, vk; int ii, ij, ik;
        tie(vi, ii) = A[i][j].top();
        tie(vj, ij) = A[j][k].top();
        tie(vk, ik) = A[k][i].top();
        if(i != ass[ii]) { A[i][j].pop(); continue; }
        if(j != ass[ij]) { A[j][k].pop(); continue; }
        if(k != ass[ik]) { A[k][i].pop(); continue; }
        ll nv = vi + vj + vk;
        if(nv > 0) {
          ans += nv;
          A[i][j].pop(); A[j][k].pop(); A[k][i].pop();
          A[i][(i + 1) % 3].emplace(a[(i + 1) % 3][ik] - a[i][ik], ik);
          A[i][(i + 2) % 3].emplace(a[(i + 2) % 3][ik] - a[i][ik], ik);
          A[j][(j + 1) % 3].emplace(a[(j + 1) % 3][ii] - a[j][ii], ii);
          A[j][(j + 2) % 3].emplace(a[(j + 2) % 3][ii] - a[j][ii], ii);
          A[k][(k + 1) % 3].emplace(a[(k + 1) % 3][ij] - a[k][ij], ij);
          A[k][(k + 2) % 3].emplace(a[(k + 2) % 3][ij] - a[k][ij], ij);
          ass[ij] = k; ass[ii] = j; ass[ik] = i;
          update = 1;
        }
        break;
      }
      swap(j, k);
    }
  }
  cout << ans << endl;
}



Measured memory_bytes: 8812