#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#define SIZE 100005
#define INF 100000000000000000LL

using namespace std;
typedef long long int ll;
typedef pair <ll,ll> P;

P pos[SIZE];
ll left[SIZE],right[SIZE];

int main()
{
	int X,Y,Z;
	scanf("%d %d %d",&X,&Y,&Z);
	int n=X+Y+Z;
	ll ret=0;
	for(int i=0;i<n;i++)
	{
		ll a,b,c;
		scanf("%lld %lld %lld",&a,&b,&c);
		ret+=a;
		pos[i]=P(b-a,c-a);
	}
	sort(pos,pos+n);
	priority_queue <ll> que;
	ll sum=0;
	for(int i=n-1;i>=0;i--)
	{
		P p=pos[i];
		que.push(p.second-p.first);
		sum+=p.first;
		if(n-i<Y) right[i]=-1;
		else
		{
			if(n-i>Y)
			{
				sum+=que.top();
				que.pop();
			}
			right[i]=sum;
		}
	}
	while(!que.empty()) que.pop();
	sum=0;
	for(int i=0;i<n;i++)
	{
		P p=pos[i];
		que.push(p.second);
		if(i+1<X) left[i]=-1;
		else
		{
			if(i+1>X)
			{
				sum+=que.top();
				que.pop();
			}
			left[i]=sum;
		}
	}
	ll rt=-INF;
	for(int i=X-1;i<X+Z;i++)
	{
		rt=max(rt,left[i]+right[i+1]);
	}
	printf("%lld\n",ret+rt);
	return 0;
}
