#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v){stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n<<=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 1e5;

priority_queue<pii> pq[3][2];
int n, x, y, z, a[N][3];
bool Y[3][N];

main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> x >> y >> z;
  n = x + y + z;
  FOR(i, 0, n) FOR(j, 0, 3) cin >> a[i][j];
  FOR(i, 0, x){
    Y[0][i] = true;
    pq[0][0].push(pii(a[i][1]-a[i][0], i));
    pq[0][1].push(pii(a[i][2]-a[i][0], i));
  }
  FOR(i, x, x+y){
    Y[1][i] = true;
    pq[1][0].push(pii(a[i][2]-a[i][1], i));
    pq[1][1].push(pii(a[i][0]-a[i][1], i));
  }
  FOR(i, x+y, x+y+z){
    Y[2][i] = true;
    pq[2][0].push(pii(a[i][0]-a[i][2], i));
    pq[2][1].push(pii(a[i][1]-a[i][2], i));
  }
  pii t[3][2];
  while(true){
    FOR(i, 0, 3)FOR(j, 0, 2)while(true){
      t[i][j] = pq[i][j].top();
      if(Y[i][t[i][j].se]) break;
      pq[i][j].pop();
    }
    int ma = 0, _i, _j;
    FOR(i, 0, 3){
      int d = t[i][0].fi + t[(i+1)%3][1].fi;
      if(d > ma) ma = d, _i = i, _j = 2;
    }
    FOR(i, 0, 2){
      int d = t[0][i].fi + t[1][i].fi + t[2][i].fi;
      if(d > ma) ma = d, _i = i, _j = 3;
    }
    if(!ma) break;
    if(_j==3){
      FOR(i, 0, 3){
        int k = t[i][_i].se, l = (i+_i+1)%3;
        Y[i][k] = false;
        Y[l][k] = true;
        FOR(j, 0, 2) pq[l][j].push(pii(a[k][(l+j+1)%3]-a[k][l], k));
      }
    }else{
      FOR(i, 0, 2){
        int k = t[(_i+i)%3][i].se, l = (_i+1-i)%3;
        Y[(_i+i)%3][k] = false;
        Y[l][k] = true;
        FOR(j, 0, 2) pq[l][j].push(pii(a[k][(l+j+1)%3]-a[k][l], k));
      }
    }
  }
  ll ans = 0;
  FOR(i, 0, x+y+z)FOR(j, 0, 3) if(Y[j][i]) ans += a[i][j];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4468