#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define YYS(x,arr) for(auto& x:arr)
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())

#define pb emplace_back
#define fi first
#define se second
using ll = long long;
using P = pair<ll ,ll>;
using Tu = tuple<ll, ll, ll>;
const ll INFLL = 1LL<<60LL;
const ll INF = 1LL<<60LL;
const ll MOD = 1e9+7;



using ld = long double;

template<class T> T &chmin( T &a , const T &b ){ return a = min(a,b); }
template<class T> T &chmax( T &a , const T &b ){ return a = max(a,b); }
template<class T> void UNIQUE(vector<T> &a){ a.erase(unique(a.begin(), a.end()), a.end()); }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

ll in(){long long int x; assert(scanf("%lld", &x) == 1); return x;}
ld fin(){double x; assert(scanf("%lf", &x) == 1); return x;}
char yuyushiki[1000010]; string stin(){assert(scanf("%s", yuyushiki) == 1); return yuyushiki;}


vector<vector<set<P> > > st(3, vector<set<P> >(3));
vector<set<ll>> ans(3);
vector<vector<ll> > v;
void erase_set(ll i, ll from){
  assert(ans[from].find(i) != ans[from].end());
  ans[from].erase(ans[from].find(i));
  for(int j=0;j<3;j++){
    if(j == from)
      continue;
    assert(st[from][j].find(P(v[i][j] - v[i][from], i)) != st[from][j].end());
    st[from][j].erase(st[from][j].find(P(v[i][j] - v[i][from], i)));
  }
}

void add_set(ll i, ll to){
  ans[to].insert(i);
  for(int j=0;j<3;j++){
    if(j == to)
      continue;
    st[to][j].insert(P(v[i][j] - v[i][to], i));
  } 
}

int main(){
  ll X, Y, Z;
  cin >> X >> Y >> Z;
  v.resize(X + Y + Z);
  for(int i=0;i<X + Y + Z;i++){
    ll x, y, z;
    cin >> x >> y >> z;
    v[i] = vector<ll>{x, y, z};
    ll to;
    if(i < X)
      to = 0;
    else if(i < X + Y)
      to = 1;
    else
      to = 2;
    add_set(i, to);
  }
  while(true){
    bool nothing = true;
    for(int i=0;i<3;i++)
      for(int j=i+1;j<3;j++){
	if(st[i][j].rbegin()->first + st[j][i].rbegin()->first > 0){
	  ll idi = st[i][j].rbegin()->second;
	  ll idj = st[j][i].rbegin()->second;
	  assert(idi != idj);
	  erase_set(idi, i);
	  erase_set(idj, j);
	  add_set(idi, j);
	  add_set(idj, i);
	  nothing = false;
	}
      }
    // ABC
    if(st[0][1].rbegin()->first + st[1][2].rbegin()->first + st[2][0].rbegin()->first > 0){
      ll id0 = st[0][1].rbegin()->second;
      ll id1 = st[1][2].rbegin()->second;
      ll id2 = st[2][0].rbegin()->second;
      assert(id0 != id1 && id1 != id2 && id2 != id0);
      erase_set(id0, 0);
      erase_set(id1, 1);
      erase_set(id2, 2);
      add_set(id0, 1);
      add_set(id1, 2);
      add_set(id2, 0);
      nothing = false;
    }
    // ACB
    if(st[0][2].rbegin()->first + st[2][1].rbegin()->first + st[1][0].rbegin()->first > 0){
      ll id0 = st[0][2].rbegin()->second;
      ll id1 = st[1][0].rbegin()->second;
      ll id2 = st[2][1].rbegin()->second;
      assert(id0 != id1 && id1 != id2 && id2 != id0);
      erase_set(id0, 0);
      erase_set(id1, 1);
      erase_set(id2, 2);
      add_set(id0, 2);
      add_set(id2, 1);
      add_set(id1, 0);
      nothing = false;
    }
    if(nothing)
      break;
  }
  /*for(int i=0;i<3;i++){
    for(auto x : ans[i])
      cout << x << " ";
    cout << endl;
    }*/
  ll answer = 0;
  for(int i=0;i<3;i++)
    for(auto x : ans[i])
      answer += v[x][i];
  cout << answer << endl;
}


Measured memory_bytes: 22912