#include<bits/stdc++.h>
#define ll long long
using namespace std;
inline int rd(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-') f=0;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}
	return f?x:-x;
}
struct Node{
	int a,b,c;
}t[100050]; 
bool cmp(Node a,Node b){
	return a.a-a.b<b.a-b.b;
}
int n,X,Y,Z;
ll tot=0,ans=0;
priority_queue<ll,vector<ll>,greater<ll> >q;
ll lef[100050];
int main(){
	X=rd(),Y=rd(),Z=rd();n=X+Y+Z;
	for(int i=1;i<=n;i++){
		t[i].a=rd(),t[i].b=rd(),t[i].c=rd();
		tot+=t[i].c;
	}sort(t+1,t+1+n,cmp);
	ll sum=0;
	for(int i=1;i<=Y;i++){
		sum+=t[i].b-t[i].c;
		q.push(t[i].b-t[i].c);
	}
	for(int i=Y+1;i<=n-X+1;i++){
		lef[i]=sum;sum+=t[i].b-t[i].c;
		q.push(t[i].b-t[i].c);
		sum-=q.top();q.pop();
	}
	while(!q.empty()) q.pop();sum=0;
	for(int i=n;i>n-X;i--){
		sum+=t[i].a-t[i].c;
		q.push(t[i].a-t[i].c);
	}
	for(int i=n-X;i>=Y;i--){
		ans=max(ans,tot+lef[i+1]+sum);
		sum+=t[i].a-t[i].c;
		q.push(t[i].a-t[i].c);
		sum-=q.top();q.pop();
	}
	cout<<ans;
	return 0;
}