#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

struct st{int a,b,c;}s[200000];
ll sumx[200000],sumy[200000];

int main(){
	int x,y,z;cin>>x>>y>>z;
	int n=x+y+z;
	rep(i,n){
		scanf("%d%d%d",&s[i].a,&s[i].b,&s[i].c);
	}
	sort(s,s+n,[](st a,st b){
		return a.a-a.b>b.a-b.b;
	});
	ll sum=0;
	priority_queue<P>que;
	rep(i,x){
		que.push(P(s[i].c-s[i].a,i));
		sum+=s[i].a;		
	}
	sumx[x-1]=sum;
	for(int i=x;i<n;i++){
		if(que.top().first>s[i].c-s[i].a){
			auto p=que.top();que.pop();
			sum-=s[p.second].a;
			sum+=s[p.second].c;
			que.push(P(s[i].c-s[i].a,i));
			sum+=s[i].a;
		}
		else{
			sum+=s[i].c;
		}
		sumx[i]=sum;
	}
	sum=0;
	while(!que.empty())que.pop();
	for(int i=n-1;i>=n-y;i--){
		que.push(P(s[i].c-s[i].b,i));
		sum+=s[i].b;
	}
	sumy[n-y]=sum;
	for(int i=n-y-1;i>=0;i--){
		if(que.top().first>s[i].c-s[i].b){
			auto p=que.top();que.pop();
			sum-=s[p.second].b;
			sum+=s[p.second].c;
			que.push(P(s[i].c-s[i].b,i));
			sum+=s[i].b;
		}
		else{
			sum+=s[i].c;
		}
		sumy[i]=sum;
	}
	ll ans=0;
	for(int i=x-1;i<n-y;i++){
		ans=max(ans,sumx[i]+sumy[i+1]);
	}
	cout<<ans<<endl;
}