//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define bged(v) (v).begin(),(v).end()
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
typedef long long ll;
const int Imx=2147483647;
const ll Lbig=2e18;
const int mod=1e9+7;
//My i/o stream
struct fastio
{
	char s[100000];
	int it,len;
	fastio(){it=len=0;}
	inline char get()
	{
		if(it<len)return s[it++];it=0;
		len=fread(s,1,100000,stdin);
		if(len==0)return EOF;else return s[it++];
	}
	bool notend()
	{
		char c=get();
		while(c==' '||c=='\n')c=get();
		if(it>0)it--;
		return c!=EOF;
	}
}_buff;
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putchar(' ')
#define putii(x,y) puti(x),puti(y)
#define putiii(x,y,z) putii(x,y),puti(z)
#define putsi(x) putnum(x),putchar('\n')
#define putsii(x,y) puti(x),putsi(y)
#define putsiii(x,y,z) putii(x,y),putsi(z)
inline ll getnum()
{
	ll r=0;bool ng=0;char c;c=_buff.get();
	while(c!='-'&&(c<'0'||c>'9'))c=_buff.get();
	if(c=='-')ng=1,c=_buff.get();
	while(c>='0'&&c<='9')r=r*10+c-'0',c=_buff.get();
	return ng?-r:r;
}
template<class T> inline void putnum(T x)
{
	if(x<0)putchar('-'),x=-x;
	register short a[20]={},sz=0;
	while(x)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1;i>=0;i--)putchar('0'+a[i]);
}
inline char getreal(){char c=_buff.get();while(c==' '||c=='\n')c=_buff.get();return c;}
int X,Y,Z,n;
int A[100111],B[100111],C[100111];
set<pair<int,int> >stab,stac,stba,stbc,stca,stcb;
int ty[100111];
ll ans;
void add(int id)
{
	if(ty[id]==0)stab.insert(MP(A[id]-B[id],id)),stac.insert(MP(A[id]-C[id],id)),ans+=A[id];
	if(ty[id]==1)stba.insert(MP(B[id]-A[id],id)),stbc.insert(MP(B[id]-C[id],id)),ans+=B[id];
	if(ty[id]==2)stca.insert(MP(C[id]-A[id],id)),stcb.insert(MP(C[id]-B[id],id)),ans+=C[id];
}
void del(int id)
{
	if(ty[id]==0)stab.erase(MP(A[id]-B[id],id)),stac.erase(MP(A[id]-C[id],id)),ans-=A[id];
	if(ty[id]==1)stba.erase(MP(B[id]-A[id],id)),stbc.erase(MP(B[id]-C[id],id)),ans-=B[id];
	if(ty[id]==2)stca.erase(MP(C[id]-A[id],id)),stcb.erase(MP(C[id]-B[id],id)),ans-=C[id];
}
int main()
{
	getiii(X,Y,Z);
	n=X+Y+Z;
	for(int i=1;i<=n;i++)
	{
		getiii(A[i],B[i],C[i]);
		if(X>0)X--,ty[i]=0;
		else if(Y>0)Y--,ty[i]=1;
		else if(Z>0)Z--,ty[i]=2;
		add(i);
	}
//	for(int i=1;i<=n;i++)cerr<<ty[i]<<" ";cerr<<endl;
//	cerr<<"ans="<<ans<<endl;
	while(true)
	{
		bool ok=0;
		int x,y,z;
		if(stab.begin()->FF+stba.begin()->FF<0)
		{
			ok=1;
			x=stab.begin()->SS;
			y=stba.begin()->SS;
			del(x);del(y);
			ty[x]=1;ty[y]=0;
			add(x);add(y);
		}
		if(stbc.begin()->FF+stcb.begin()->FF<0)
		{
			ok=1;
			x=stbc.begin()->SS;
			y=stcb.begin()->SS;
			del(x);del(y);
			ty[x]=2;ty[y]=1;
			add(x);add(y);
		}
		if(stac.begin()->FF+stca.begin()->FF<0)
		{
			ok=1;
			x=stac.begin()->SS;
			y=stca.begin()->SS;
			del(x);del(y);
			ty[x]=2;ty[y]=0;
			add(x);add(y);
		}
		if(stab.begin()->FF+stbc.begin()->FF+stca.begin()->FF<0)
		{
			ok=1;
			x=stab.begin()->SS;
			y=stbc.begin()->SS;
			z=stca.begin()->SS;
			del(x);del(y);del(z);
			ty[x]=1;ty[y]=2;ty[z]=0;
			add(x);add(y);add(z);
		}
		if(stba.begin()->FF+stcb.begin()->FF+stac.begin()->FF<0)
		{
			ok=1;
			x=stba.begin()->SS;
			y=stcb.begin()->SS;
			z=stac.begin()->SS;
			del(x);del(y);del(z);
			ty[x]=0;ty[y]=1;ty[z]=2;
			add(x);add(y);add(z);
		}
		if(!ok)break;
//	for(int i=1;i<=n;i++)cerr<<ty[i]<<" ";cerr<<endl;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 11264