#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000000000000



int main(){

	int X,Y,Z;
	cin>>X>>Y>>Z;
	int N = X+Y+Z;
	vector<vector<long long>> C(X+Y+Z);
	long long ans = 0LL;
	for(int i=0;i<X+Y+Z;i++){
		long long a,b,c;
		cin>>a>>b>>c;
		C[i] = {b-a,a,b,c};
		ans += a;
	}
	
	sort(C.begin(),C.end());
	vector<long long> Acnt(N);
	
	{
		priority_queue<long long> Q;
		long long S = 0;
		for(int i=0;i<N;i++){
			long long t = C[i][3]-C[i][1];
			Q.push(t);
			if(Q.size()>X){
				S += Q.top();
				Q.pop();
			}
			Acnt[i] = S;
		}
	}
	
	long long Maxi = -Inf;
	long long t = 0LL;
	priority_queue<long long> Q;
	for(int i=N-1;i>=0;i--){
		t += C[i][0];
		Q.push(C[i][3]-C[i][2]);
		if(Q.size()>Y){
			t += Q.top();
			Q.pop();
		}
		if(i<X)break;
		if(Q.size()==Y){
			Maxi = max(Maxi,t+Acnt[i-1]);
		}
	}
	
	cout<<ans+Maxi<<endl;
	
	return 0;
}