#include<cstdio>
#include<algorithm>
#include<queue>
int X,Y,Z;
struct item{
	int A,B,C;
	bool operator<(const item&it)const{return C-B<it.C-it.B;}
}items[100010];
long long SB[100010],SC[100010];
void get_SB(){
	std::priority_queue<int>Q;
	long long s=0;
	for(int i=0;i<X+Y+Z;i++){
		Q.push(items[i].A-items[i].B);
		s+=items[i].B;
		if(Q.size()>Y)s+=Q.top(),Q.pop();
		SB[i+1]=s;
	}
}
void get_SC(){
	std::priority_queue<int>Q;
	long long s=0;
	for(int i=X+Y+Z;i--;){
		Q.push(items[i].A-items[i].C);
		s+=items[i].C;
		if(Q.size()>Z)s+=Q.top(),Q.pop();
		SC[i]=s;
	}
}
int main(){
	scanf("%d%d%d",&X,&Y,&Z);
	for(int i=0;i<X+Y+Z;i++)scanf("%d%d%d",&items[i].A,&items[i].B,&items[i].C);
	std::sort(items,items+X+Y+Z);
	get_SB();
	get_SC();
	long long ans=-1ll<<62;
	for(int i=Y;i<=X+Y;i++)if(SB[i]+SC[i]>ans)ans=SB[i]+SC[i];
	printf("%lld\n",ans);
}