// #includes {{{
#include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define debug_v(x) cerr << #x << " = [";REP(__ind,(x).size()){cerr << (x)[__ind] << ", ";}cerr << "] (L" << __LINE__ << ")" << endl;

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;
template<class T>
T inf(){ return (numeric_limits<T>::max()>>1);}

typedef pair<int,int> pii;

/*
#ifdef MYDEBUG
#include"debug.h"
#include"print.h"
#endif
*/
// }}}

//{{{ io
FILE *file_in=stdin,*file_out=stdout;
#define fin normal_in
#define fout normal_out
//const char fname[]="";
//FILE *fin=fopen(fname,"r"),*fout=fopen(fname,"w");
#ifdef __MINGW32__
#define LLD "%I64d"
#define LLU "%I64u"
#else
#define LLD "%lld"
#define LLU "%llu"
#endif
struct NORMAL_IN{
	bool cnt;
	NORMAL_IN():cnt(true){}
	operator int() const {return cnt;}
#define endl "\n"
	NORMAL_IN& operator>>(int &n){cnt=fscanf(file_in,"%d",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned int &n){cnt=fscanf(file_in,"%u",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long long &n){cnt=fscanf(file_in,LLD,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(unsigned long long &n){cnt=fscanf(file_in,LLU,&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(double &n){cnt=fscanf(file_in,"%lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(long double &n){cnt=fscanf(file_in,"%Lf",&n)!=EOF;return *this;}
	NORMAL_IN& operator>>(char *c){cnt=fscanf(file_in,"%s",c)!=EOF;return *this;}
	NORMAL_IN& operator>>(string &s){
		s.clear();
		for(bool r=false;;){
			const char c=getchar();
			if(c==EOF){ cnt=false; break;}
			const int t=isspace(c);
			if(!r and !t)r=true;
			if(r){
				if(!t)s.push_back(c);
				else break;
			}
		}
		return *this;
	}
	template<class T>
		NORMAL_IN& operator>>(vector<T> &v){
			int n;fscanf(file_in,"%d",&n);
			REP(i,n){
				T t;*this>>t;
				v.push_back(t);
			}
		}
} normal_in;

struct NORMAL_OUT{
	NORMAL_OUT& operator<<(const int &n){fprintf(file_out,"%d",n);return *this;}
	NORMAL_OUT& operator<<(const unsigned int &n){fprintf(file_out,"%u",n);return *this;}
	NORMAL_OUT& operator<<(const long long &n){fprintf(file_out,LLD,n);return *this;}
	NORMAL_OUT& operator<<(const unsigned long long &n){fprintf(file_out,LLU,n);return *this;}
	NORMAL_OUT& operator<<(const double &n){fprintf(file_out,"%lf",n);return *this;}
	NORMAL_OUT& operator<<(const long double &n){fprintf(file_out,"%Lf",n);return *this;}
	NORMAL_OUT& operator<<(const char c[]){fprintf(file_out,"%s",c);return *this;}
	NORMAL_OUT& operator<<(const string &s){fprintf(file_out,"%s",s.c_str());return *this;}
} normal_out;
//}}}

struct S{
	Int A,B,C;
	bool operator<(const S &s) const{
		return A-B > s.A-s.B;
	}
};

void solve(long long X, long long Y, long long Z, vector<long long> A, vector<long long> B, vector<long long> C){
	vector<S> v;
	const int N = X + Y + Z;
	REP(i,N)v.push_back(S{A[i],B[i],C[i]});
	sort(ALL(v));
	vector<Int> upper(N+1), lower(N+1);
	{
		priority_queue<S,vector<S>, auto(*)(const S &,const S &)->bool > q{
			[](const S &l, const S &r){
				return l.A-l.C > r.A-r.C;
			}};
		Int sum = 0;
		for(int i=0;i<N+1;i++){
			if(q.size()==X){
				upper[i] = sum;
			}else{
				upper[i] = -inf<Int>();
			}
			if(i==N)break;
			//add v[i]
			sum += v[i].A-v[i].C;
			q.push(v[i]);
			if(q.size()>X){
				assert(q.size()==X+1);
				S t = q.top();
				sum -= t.A - t.C;
				q.pop();
			}
		}
	}

	{
		priority_queue<S,vector<S>, auto(*)(const S &,const S &)->bool > q{
			[](const S &l, const S &r){
				return l.B-l.C > r.B-r.C;
			}};

		Int sum = 0;
		for(int i=N;i>=0;i--){
			if(q.size()==Y){
				lower[i] = sum;
			}else{
				lower[i] = -inf<Int>();
			}
			if(i==0)break;
			//add v[i]
			sum += v[i-1].B-v[i-1].C;
			q.push(v[i-1]);
			if(q.size()>Y){
				assert(q.size()==Y+1);
				S t = q.top();
				sum -= t.B - t.C;
				q.pop();
			}
		}
	}
	Int ans = -inf<Int>();
	REP(i,N+1){
		ans = max(ans,upper[i] + lower[i]);
	}
	Int result = ans + accumulate(ALL(C),0ll);
	assert(result>=0);
	fout<<result<<endl;
}

int main(){	
	long long Z;
	long long X;
	long long Y;
	fin >> X;
	fin >> Y;
	fin >> Z;
	vector<long long> A(((X+Y)+Z)-1+1);
	vector<long long> C(((X+Y)+Z)-1+1);
	vector<long long> B(((X+Y)+Z)-1+1);
	for(int i = 0 ; i <= ((X+Y)+Z)-1 ; i++){
		fin >> A[i];
		fin >> B[i];
		fin >> C[i];
	}
	solve(X, Y, Z, A, B, C);
	return 0;
}



Measured memory_bytes: 14320