#include <iostream>
#include <queue>
#include <utility>
#define ll long long
using namespace std;

ll coin[100010][3];
int choice[100010];
priority_queue<pair<ll, int>> xy, xz, yz;

int main() {
	int X, Y, Z;
	cin >> X >> Y >> Z;
	for(int i=0; i<X+Y+Z; ++i){
	    cin >> coin[i][0] >> coin[i][1] >> coin[i][2];
	    xy.push(make_pair(coin[i][1]-coin[i][0], i));
	}
	for(int i=0; i<Y; ++i){
	    choice[xy.top().second]=1;
	    xy.pop();
	}
	for(int i=0; i<X+Y+Z; ++i){
	    if(choice[i]==1) yz.push(make_pair(coin[i][2]-coin[i][1], i));
	    else xz.push(make_pair(coin[i][2]-coin[i][0], i));
	}
	for(int i=0; i<Z; ++i){
	    while(choice[xy.top().second]>0) xy.pop();
	    while(choice[xz.top().second]>0) xz.pop();
	    if(xy.top().first+yz.top().first<xz.top().first){
	        choice[xz.top().second]=2;
	        xz.pop();
	    }
	    else{
	        choice[yz.top().second]=2;
	        yz.pop();
	        int h=xy.top().second;
	        choice[h]=1;
	        yz.push(make_pair(coin[h][2]-coin[h][1], h));
	        xy.pop();
	    }
	}
	ll ans=0;
	for(int i=0; i<X+Y+Z; ++i) ans += coin[i][choice[i]];
	cout << ans << endl;
	return 0;
}
