#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int X,Y,Z;
LL A[100001];
LL B[100001];
LL C[100001];
bool used[100001];
typedef pair<LL,LL> P;
vector<P>v;
LL dp[100001];
LL dp2[100001];


LL ans=0;
int main(){
   cin>>X>>Y>>Z;
   REP(i,X+Y+Z){
       cin>>A[i]>>B[i]>>C[i];
       v.push_back(P(A[i]-C[i],i));
   }
   sort(v.begin(),v.end(),greater<P>());
   priority_queue<LL>que;
   REP(i,X){
       int num=v[i].second;
       dp[0]+=A[num];
       que.push(B[num]-A[num]);
   }
   for(int i=1;i<=Y;i++){
       int num=v[X+i-1].second;
       que.push(B[num]-A[num]);
       LL a=que.top();que.pop();
       dp[i]=a+dp[i-1]+A[num];
   }
   priority_queue<LL>que2;
   for(int i=X+Y+Z-1;i>=X+Y;i--){
       int num=v[i].second;
       dp2[0]+=C[num];
       que2.push(B[num]-C[num]);
   }
   for(int i=1;i<=Y;i++){
       int num=v[X+Y-i].second;
       que2.push(B[num]-C[num]);
       LL a=que2.top();que2.pop();
       dp2[i]=a+dp2[i-1]+C[num];
   }
   LL aaa=0;
   REP(i,Y+1){
       //cout<<dp[i]<<" "<<dp[Y-i]<<" "<<dp[i]+dp[Y-i]<<endl;
       aaa=max(aaa,dp[i]+dp2[Y-i]);
   }
   cout<<aaa<<endl;
   return(0);
}