#include <bits/stdc++.h>

#define MAXN (100010)
#define ll long long

ll ans;
int x, y, z, n;
int a[MAXN], b[MAXN], c[MAXN];
ll pre[MAXN], suf[MAXN];
std::vector<std::pair<int, int> > vec;

int main(){
	scanf("%d%d%d", &x, &y, &z);
	n = x + y + z;
	for(int i = 0; i < n; ++ i){
		scanf("%d%d%d", a + i, b + i, c + i);
		a[i] -= c[i];
		b[i] -= c[i];
		vec.push_back({a[i] - b[i], i});
	}
	std::sort(vec.begin(), vec.end());
	//cal pre
	std::multiset<int> set;
	ll sum = 0;
	for(int i = 0; i < y; ++ i){
		set.insert(b[vec[i].second]);
		sum += b[vec[i].second];
	}
	pre[y - 1] = sum;
	for(int i = y; i < y + z; ++ i){
		sum += b[vec[i].second];
		set.insert(b[vec[i].second]);
		int tmp = *set.begin();
		sum -= tmp;
		set.erase(set.find(tmp));
		pre[i] = sum;
	}
	//cal suf
	set.clear();
	sum = 0;
	for(int i = n - 1; i >= y + z; -- i){
		set.insert(a[vec[i].second]);
		sum += a[vec[i].second];
	}
	suf[y + z] = sum;
	for(int i = y + z - 1; i >= y; -- i){
		sum += a[vec[i].second];
		set.insert(a[vec[i].second]);
		int tmp = *set.begin();
		sum -= tmp;
		set.erase(set.find(tmp));
		suf[i] = sum;
	}
	
	ans = LLONG_MIN;
	for(int i = y; i <= y + z; ++ i){
		ans = std::max(ans, pre[i - 1] + suf[i]);
	}
	for(int i = 0; i < n; ++ i){
		ans += c[i];
	}
	
	printf("%lld\n", ans);
	
	return 0;
}