#include <cstdio>
#include <cstdlib>

int X, Y, Z;
long long A[100010], B[100010], C[100010];
int num[100010];
int n;
int idx[100010];
long long res;

long long H[6][1200100];
int H2[6][1200100];
int Hns[6];
int Hn;
void addHeap(int d, long long x, int p)
{
	Hn = Hns[d];
	Hn ++;
	H[d][Hn] = x;
	H2[d][Hn] = p;
	int i=Hn, j;
	while(i>1){
		j = i/2;
		if(H[d][j] < x){
			H[d][i] = H[d][j];
			H2[d][i] = H2[d][j];
			i = j;
		}
		else
			break;
	}
	H[d][i] = x;
	H2[d][i] = p;
	Hns[d] = Hn;
}

void delHeap(int d, long long &x, int &p)
{
	Hn = Hns[d];
	x = H[d][1];
	p = H2[d][1];
	long long tmp = H[d][Hn];
	int tmp2 = H2[d][Hn];
	Hn --;
	int i = 1, j;
	while(2*i<=Hn){
		j = 2*i;
		if(j+1<=Hn && H[d][j+1]>H[d][j])
			j ++;
		if(H[d][j] > tmp){
			H[d][i] = H[d][j];
			H2[d][i] = H2[d][j];
			i = j;
		}
		else
			break;
	}
	H[d][i] = tmp;
	H2[d][i] = tmp2;
	Hns[d] = Hn;
}

int cmp1(const void *aa, const void *bb)
{
	int i1 = *((int *)aa);
	int i2 = *((int *)bb);
	if(A[i2] - A[i1] > 0)
		return 1;
	else if(A[i2] - A[i1] < 0)
		return -1;
	return 0;
}

int cmp2(const void *aa, const void *bb)
{
	int i1 = *((int *)aa);
	int i2 = *((int *)bb);
	if(B[i2] - B[i1] > 0)
		return 1;
	else if(B[i2] - B[i1] < 0)
		return -1;
	return 0;
}

int cmp3(const void *aa, const void *bb)
{
	int i1 = *((int *)aa);
	int i2 = *((int *)bb);
	if(C[i2] - C[i1] > 0)
		return 1;
	else if(C[i2] - C[i1] < 0)
		return -1;
	return 0;
}

void solve()
{
	int i;
	res = 0;
	n = X + Y + Z;
	for(i=0; i<n; i++)
		num[i] = -1;
	for(i=0; i<n; i++)
		idx[i] = i;
	qsort(idx, n, sizeof(int), cmp1);
	int cnt = 0;
	for(i=0; i<n; i++){
		if(num[idx[i]] == -1){
			num[idx[i]] = 0;
			res += A[idx[i]];
			cnt ++;
			if(cnt == X)
				break;
		}
	}
	
	for(i=0; i<n; i++)
		idx[i] = i;
	qsort(idx, n, sizeof(int), cmp2);
	cnt = 0;
	for(i=0; i<n; i++){
		if(num[idx[i]] == -1){
			num[idx[i]] = 1;
			res += B[idx[i]];
			cnt ++;
			if(cnt == Y)
				break;
		}
	}
	
	for(i=0; i<n; i++)
		idx[i] = i;
	qsort(idx, n, sizeof(int), cmp3);
	cnt = 0;
	for(i=0; i<n; i++){
		if(num[idx[i]] == -1){
			num[idx[i]] = 2;
			res += C[idx[i]];
			cnt ++;
			if(cnt == Z)
				break;
		}
	}
	/*for(i=0; i<X; i++){
		num[i] = 0;
		res += A[i];
	}
	for(i=0; i<Y; i++){
		num[X+i] = 1;
		res += B[X+i];
	}
	for(i=0; i<Z; i++){
		num[X+Y+i] = 2;
		res += C[X+Y+i];
	}*/
	
	Hns[0] = Hns[1] = Hns[2] = Hns[3] = Hns[4] = Hns[5] = 0;
	for(i=0; i<n; i++){
		if(num[i] == 0){
			addHeap(0, B[i]-A[i], i);
			addHeap(1, C[i]-A[i], i);
		}
		else if(num[i] == 1){
			addHeap(2, A[i]-B[i], i);
			addHeap(3, C[i]-B[i], i);
		}
		else{
			addHeap(4, A[i]-C[i], i);
			addHeap(5, B[i]-C[i], i);
		}
	}
	while(1){
		long long x1, x2, x3;
		int p1, p2, p3;
		while(1){
			delHeap(0, x1, p1);
			if(num[p1] == 0)
				break;
		}
		while(1){
			delHeap(2, x2, p2);
			if(num[p2] == 1)
				break;
		}
		if(x1+x2>0){
			num[p1] = 1;
			num[p2] = 0;
			addHeap(2, A[p1]-B[p1], p1);
			addHeap(3, C[p1]-B[p1], p1);
			addHeap(0, B[p2]-A[p2], p2);
			addHeap(1, C[p2]-A[p2], p2);
			res += x1+x2;
			continue;
		}
		addHeap(0, x1, p1);
		addHeap(2, x2, p2);
		
		while(1){
			delHeap(1, x1, p1);
			if(num[p1] == 0)
				break;
		}
		while(1){
			delHeap(4, x2, p2);
			if(num[p2] == 2)
				break;
		}
		if(x1+x2>0){
			num[p1] = 2;
			num[p2] = 0;
			addHeap(4, A[p1]-C[p1], p1);
			addHeap(5, B[p1]-C[p1], p1);
			addHeap(0, B[p2]-A[p2], p2);
			addHeap(1, C[p2]-A[p2], p2);
			res += x1+x2;
			continue;
		}
		addHeap(1, x1, p1);
		addHeap(4, x2, p2);
		
		while(1){
			delHeap(3, x1, p1);
			if(num[p1] == 1)
				break;
		}
		while(1){
			delHeap(5, x2, p2);
			if(num[p2] == 2)
				break;
		}
		if(x1+x2>0){
			num[p1] = 2;
			num[p2] = 1;
			addHeap(4, A[p1]-C[p1], p1);
			addHeap(5, B[p1]-C[p1], p1);
			addHeap(2, A[p2]-B[p2], p2);
			addHeap(3, C[p2]-B[p2], p2);
			res += x1+x2;
			continue;
		}
		addHeap(3, x1, p1);
		addHeap(5, x2, p2);
		
		//A-B B-C C-A
		while(1){
			delHeap(0, x1, p1);
			if(num[p1] == 0)
				break;
		}
		while(1){
			delHeap(3, x2, p2);
			if(num[p2] == 1)
				break;
		}
		while(1){
			delHeap(4, x3, p3);
			if(num[p3] == 2)
				break;
		}
		if(x1+x2+x3>0){
			num[p1] = 1;
			num[p2] = 2;
			num[p3] = 0;
			addHeap(2, A[p1]-B[p1], p1);
			addHeap(3, C[p1]-B[p1], p1);
			addHeap(4, A[p2]-C[p2], p2);
			addHeap(5, B[p2]-C[p2], p2);
			addHeap(0, B[p3]-A[p3], p3);
			addHeap(1, C[p3]-A[p3], p3);
			res += x1+x2+x3;
			continue;
		}
		addHeap(0, x1, p1);
		addHeap(3, x2, p2);
		addHeap(4, x3, p3);
		
		//A-C C-B B-A
		while(1){
			delHeap(1, x1, p1);
			if(num[p1] == 0)
				break;
		}
		while(1){
			delHeap(5, x2, p2);
			if(num[p2] == 2)
				break;
		}
		while(1){
			delHeap(2, x3, p3);
			if(num[p3] == 1)
				break;
		}
		if(x1+x2+x3>0){
			num[p1] = 2;
			num[p2] = 1;
			num[p3] = 0;
			
			addHeap(4, A[p1]-C[p1], p1);
			addHeap(5, B[p1]-C[p1], p1);
			addHeap(2, A[p2]-B[p2], p2);
			addHeap(3, C[p2]-B[p2], p2);
			addHeap(0, B[p3]-A[p3], p3);
			addHeap(1, C[p3]-A[p3], p3);
			res += x1+x2+x3;
			continue;
		}
		addHeap(1, x1, p1);
		addHeap(5, x2, p2);
		addHeap(2, x3, p3);
		
		break;
	}
	printf("%lld\n", res);
}

int main()
{
	//test();
	//freopen("in.txt", "r", stdin);
	int i;
	scanf("%d%d%d", &X, &Y, &Z);
	for(i=0; i<X+Y+Z; i++)
		scanf("%lld%lld%lld", &A[i], &B[i], &C[i]);
	/*X = Y = Z = 1;
	A[0] = 55; A[1] = 24; A[2] = 83;
	B[0] = 10; B[1] = 37; B[2] = 95;
	C[0] = 59; C[1] = 48; C[2] = 41;//198*/
	solve();
	return 0;
}

Measured memory_bytes: 30964