#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <queue>

#define For(i, j, k) for(int i = j; i <= k; i++)
#define Forr(i, j, k) for(int i = j; i >= k; i--)

using namespace std;

const int N = 100010;

struct Node{
	int A, B;
}S[N];

typedef long long LL;

LL sumc;
int X, Y, Z, n, val;

bool cmp1(Node& u, Node &v){
	return u.A - u.B > v.A - v.B;
}

LL ans = -1e18, lsum[N], rsum[N];
priority_queue<int, vector<int>, greater<int> > q;

int main(){
	scanf("%d%d%d", &X, &Y, &Z);
	swap(Y, Z);
	n = X + Y + Z;
	For(i, 1, n){
		int c;
		scanf("%d%d%d", &S[i].A, &S[i].B, &c);
		S[i].A -= c, S[i].B -= c, sumc += c;
	}
	sort(S + 1, S + n + 1, cmp1);
	For(i, 1, X) q.push(S[i].A), lsum[X] += S[i].A;
	For(i, X + 1, X + Y){
		q.push(S[i].A);
		lsum[i] = lsum[i - 1] + S[i].A - q.top(); q.pop();
	}
	while(!q.empty()) q.pop();
	Forr(i, n, X + Y + 1) rsum[X + Y + 1] += S[i].B, q.push(S[i].B);
	Forr(i, X + Y, X + 1){
		q.push(S[i].B);
		rsum[i] = rsum[i + 1] + S[i].B - q.top(); q.pop();
	}
	For(i, X, X + Y) ans = max(ans, lsum[i] + rsum[i + 1]);
	printf("%lld\n", ans + sumc);
	return 0;
}