#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#define ll long long
using namespace std;
const int N=100005;
struct node{
	ll a,b,c;
	bool operator<(const node &A)const{
	return (a-b)<A.a-A.b;}
}p[N];ll lf[N];priority_queue
<ll,vector<ll>,greater<ll> >q;
int n,m,x,y,z;ll bs=0,ans=0,sum=0;
int main(){
	scanf("%d%d%d",&x,&y,&z);n=x+y+z;
	for(int i=1;i<=n;i++)
	scanf("%lld%lld%lld",&p[i].a,&p[i].b
	,&p[i].c),bs+=p[i].c;sort(p+1,p+1+n);
	for(int i=1;i<=y;i++)
	sum+=p[i].b-p[i].c,
	q.push(p[i].b-p[i].c);
	for(int i=y+1;i<=n-x+1;i++){
		lf[i]=sum;sum+=p[i].b-p[i].c;
		q.push(p[i].b-p[i].c);
		sum-=q.top();q.pop();
	} while(q.size()) q.pop();sum=0;int t=0;
	for(int i=n;i>=n-x+1;i--)
	sum+=p[i].a-p[i].c,
	q.push(p[i].a-p[i].c),t=i;
	for(int i=t-1;i>=y;i--){
		ans=max(ans,bs+lf[i+1]+sum);
		sum+=p[i].a-p[i].c;
		q.push(p[i].a-p[i].c);
		sum-=q.top();q.pop();
	} printf("%lld\n",ans);return 0;
}