#include<bits/stdc++.h>
using namespace std;
int64_t X,Y,Z;
int main(){
  cin>>X>>Y>>Z;
  int64_t ans=0;
  vector<pair<int64_t,pair<int64_t,int64_t>>>a(X+Y+Z);
  for(int i=0;i<X+Y+Z;i++){
  int64_t A,B,C;cin>>A>>B>>C;ans+=A;
    pair<int64_t,int64_t>p(B-A,C-A);
    pair<int64_t,pair<int64_t,int64_t>>q(C-B,p);
    a.at(i)=q;
   }sort(a.begin(),a.end());
  vector<int64_t>b(X+Y+Z);
  vector<int64_t>c(X+Y+Z);
  for(int i=0;i<X+Y+Z;i++){
  pair<int64_t,int64_t>p=a.at(i).second;
    b[i]=p.first;
    c[i]=p.second;
  }vector<int64_t>b1(X+Y+Z);
  vector<int64_t>c1(X+Y+Z);
  priority_queue<int64_t,vector<int64_t>,greater<int64_t>>que1;
  int64_t b2=0;
  for(int i=0;i<Y;i++){
  b2+=b[i];que1.push(b[i]);
  }b1[Y-1]=b2;
  for(int i=Y;i<X+Y+Z;i++){
  int64_t u=que1.top();
    que1.pop();
    int64_t v=max(b[i],u);
    que1.push(v);
    b2+=(v-u);
    b1[i]=b2;
  } priority_queue<int64_t,vector<int64_t>,greater<int64_t>>que2;
  int64_t c2=0;
  for(int i=X+Y+Z-1;X+Y<=i;i--){
  c2+=c[i];que2.push(c[i]);
  }c1[X+Y]=c2;
  for(int i=X+Y-1;0<=i;i--){
  int64_t u=que2.top();
    que2.pop();
    int64_t v=max(c[i],u);
    que2.push(v);
    c2+=(v-u);
    c1[i]=c2;
  }int64_t ans1=-10000000000000000;
  for(int i=Y-1;i<=X+Y-1;i++)
    if(ans1<b1[i]+c1[i+1])ans1=b1[i]+c1[i+1];
  ans+=ans1;
  cout<<ans<<endl;
  return 0;
}