#include <cstdio>
#include <queue>
#include <algorithm>
#define ll long long
#define ps push
#define rep(i,j,k) for (i=j;i<=k;i++)
#define down(i,j,k) for (i=j;i>=k;i--)
using namespace std;
const int N=1e5+5;
int n,i,x,y,z;
ll sum,Max,ans,pre[N],suf[N];
priority_queue<int> heap;
struct arr{
	int x,y,z,key;
}a[N];
bool cmp(const arr &A,const arr &B) {
	return A.key<B.key;
}
int main()
{
//	freopen("coins.in","r",stdin);
//	freopen("coins.out","w",stdout);
	scanf("%d%d%d",&x,&y,&z); n=x+y+z;
	rep(i,1,n) scanf("%d%d%d",&a[i].x,&a[i].y,&a[i].z),a[i].key=a[i].y-a[i].x;
	sort(a+1,a+1+n,cmp);
//	rep(i,1,n) printf("%d %d %d\n",a[i].x,a[i].y,a[i].z);

	rep(i,1,x) heap.ps(a[i].z-a[i].x),sum+=a[i].x;
	rep(i,x,n-y)
	{
		pre[i]=sum+Max;
		heap.ps(a[i+1].z-a[i+1].x);
		Max+=heap.top();
		sum+=a[i+1].x;
		heap.pop();
	}
	while (!heap.empty()) heap.pop(); Max=sum=0;
	rep(i,n-y+1,n) heap.ps(a[i].z-a[i].y),sum+=a[i].y;
	down(i,n-y+1,x+1)
	{
		suf[i]=sum+Max;
		heap.ps(a[i-1].z-a[i-1].y);
		Max+=heap.top();
		sum+=a[i-1].y;
		heap.pop();
	}
	rep(i,x,n-y)
		ans=max(ans,pre[i]+suf[i+1]);
	printf("%lld\n",ans);
	return 0;
}