// Slower C++ solution:
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>



using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<ll>::iterator sit;

typedef map<ll,ll>::iterator mit;



ll a[111111];

ll b[111111];

ll c[111111];

vector<pair<ll,ii> > vec;



bool cmp(const pair<ll,ii> &a,const pair<ll,ii> &b)

{

	if(a.se.fi-a.se.se!=b.se.fi-b.se.se) return (a.se.fi-a.se.se>b.se.fi-b.se.se);

	else return (a.fi<b.fi);

}



struct PBDS

{

	tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> t;

	int timer;

	

	PBDS(){timer = 0;}

	void insert(int x)

	{

		t.insert(mp(x, timer));

		timer++;

	}

	

	int lower(int x)

	{

		return t.order_of_key(ii(x, -1));

	}

	

	void del(int x) //make sure x exists

	{

		ii tmp = (*t.find_by_order(lower(x)));

		t.erase(tmp);

	}

	

	int higher(int x)

	{

		int tmp = lower(x+1);

		return (int(t.size()) - tmp);

	}

	

	ll get(int x) //gets x-th highest

	{

		int idx = int(t.size()) - 1 - x;

		return (*t.find_by_order(idx)).fi;

	}

};



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	int x,y,z; cin>>x>>y>>z;

	int n=x+y+z;

	for(int i=0;i<n;i++)

	{

		cin>>a[i]>>b[i]>>c[i];

		vec.pb(mp(a[i],mp(b[i],c[i])));

	}

	sort(vec.begin(),vec.end(),cmp);

	PBDS L,R;

	ll suml=0; ll sumr=0;

	ll ans=0;

	for(int i=0;i<y;i++)

	{

		L.insert(vec[i].se.fi-vec[i].fi);

		suml+=vec[i].se.fi;

	}

	for(int i=y;i<n;i++)

	{

		R.insert(vec[i].se.se-vec[i].fi);

		sumr+=vec[i].fi;

	}

	for(int i=0;i<z;i++) sumr+=R.get(i);

	ans=suml+sumr;

	for(int i=y;i<n;i++)

	{

		ans=max(ans,suml+sumr);

		if(R.t.size()<=z) break; //-1 => < z to pick from

		//Remove here

		suml+=vec[i].fi;

		sumr-=vec[i].fi;

		ll tmp = L.get(y-1);

		if(vec[i].se.fi-vec[i].fi>tmp)

		{

			L.insert(vec[i].se.fi-vec[i].fi);

			suml+=vec[i].se.fi-vec[i].fi;

			suml-=tmp;

			L.del(tmp);

		}

		tmp=R.get(z-1);

		ll tmp2=vec[i].se.se-vec[i].fi;

		if(tmp2<tmp)

		{

			R.del(tmp2);

		}

		else

		{

			R.del(tmp2);

			sumr-=tmp2;

			sumr+=R.get(z-1);

		}

	}

	cout<<ans<<'\n';

}


// Faster C++ solution for the same problem (measured speedup: 1.1210486003757942x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<queue>

const int N=100005;

typedef long long ll;

const ll INF=1e18;

using namespace std;

int x,y,z,n;

ll sau[N],sag[N],scu,ans=-INF;

struct node{

    int a,b,c;

}a[N];

bool cmp(node p,node q){

    return p.a-p.b<q.a-q.b;

}

priority_queue<int,vector<int>,greater<int> > Au,Ag;

int main()

{

	scanf("%d%d%d",&x,&y,&z);

	n=x+y+z;

	for(int i=1;i<=n;i++){

		scanf("%d%d%d",&a[i].a,&a[i].b,&a[i].c);

		a[i].a-=a[i].c,a[i].b-=a[i].c;

	}

	sort(a+1,a+n+1,cmp);

	for(int i=n;i;i--)

	{

		sau[i]=sau[i+1]+a[i].a;

		Au.push(a[i].a);

		if(Au.size()>x){

            sau[i]-=Au.top();

            Au.pop();

        }

	}

	for(int i=1;i<=n;i++){

		sag[i]=sag[i-1]+a[i].b;

		Ag.push(a[i].b);

		if(Ag.size()>y){

            sag[i]-=Ag.top();

            Ag.pop();

        }

	}

	for(int i=1;i<=n;i++)

        scu+=a[i].c;

	for(int i=y;i<=n-x;i++)

        ans=max(ans,sau[i+1]+sag[i]);

	printf("%lld\n",ans+scu);

}