#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
const int N=100005;
typedef long long ll;
const ll INF=1e18;
using namespace std;
int x,y,z,n;
ll sau[N],sag[N],scu,ans=-INF;
struct node{
    int a,b,c;
}a[N];
bool cmp(node p,node q){
    return p.a-p.b<q.a-q.b;
}
priority_queue<int,vector<int>,greater<int> > Au,Ag;
int main()
{
	scanf("%d%d%d",&x,&y,&z);
	n=x+y+z;
	for(int i=1;i<=n;i++){
		scanf("%d%d%d",&a[i].a,&a[i].b,&a[i].c);
		a[i].a-=a[i].c,a[i].b-=a[i].c;
	}
	sort(a+1,a+n+1,cmp);
	for(int i=n;i;i--)
	{
		sau[i]=sau[i+1]+a[i].a;
		Au.push(a[i].a);
		if(Au.size()>x){
            sau[i]-=Au.top();
            Au.pop();
        }
	}
	for(int i=1;i<=n;i++){
		sag[i]=sag[i-1]+a[i].b;
		Ag.push(a[i].b);
		if(Ag.size()>y){
            sag[i]-=Ag.top();
            Ag.pop();
        }
	}
	for(int i=1;i<=n;i++)
        scu+=a[i].c;
	for(int i=y;i<=n-x;i++)
        ans=max(ans,sau[i+1]+sag[i]);
	printf("%lld\n",ans+scu);
}
