#include<bits/stdc++.h>
#define ll long long
using namespace std;
const ll maxn=100005;
ll x,y,z,n;
ll ans=0;
struct node{
	ll a,b,c;
}e[maxn];
bool cmp(node x,node y){
	return x.a-x.b>y.a-y.b;
}
ll l[maxn],r[maxn];
priority_queue<ll> q;
int main(){
	scanf("%lld%lld%lld",&x,&y,&z);
	n=x+y+z;
	for(ll i=1;i<=x+y+z;i++){
		scanf("%lld%lld%lld",&e[i].a,&e[i].b,&e[i].c);
	}	
	sort(e+1,e+1+n,cmp);
	ll sum=0;
	for(ll i=1;i<=x;i++){
		sum=sum+e[i].a;
		q.push(e[i].c-e[i].a);
	}
	l[x]=sum;
	for(ll i=x+1;i<=x+z;i++){
		ll x=q.top();
		if(x+e[i].a<e[i].c)sum=sum+e[i].c;
		else{
			sum=sum+x+e[i].a;
			q.pop();
			q.push(e[i].c-e[i].a);
		}
		l[i]=sum;
	}
	while(!q.empty()) q.pop();
	sum=0;
	for (ll i=n;i>n-y;i--){
		sum=sum+e[i].b;
		q.push(e[i].c-e[i].b);
	}
	r[n-y+1]=sum;
	for (ll i=n-y;i>x;i--){
		ll x=q.top();
		if(x+e[i].b<e[i].c)sum=sum+e[i].c;
		else{
			sum=sum+x+e[i].b;
			q.pop();
			q.push(e[i].c-e[i].b);
		}
		r[i]=sum;
	}
	for(ll i=x;i<=x+z;i++){
		ans=max(ans,l[i]+r[i+1]);
	}	
	printf("%lld\n",ans);
	return 0;
}
