#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e16;

int n, x, y, z;
long long ans = -INF, delta;
vector<tuple<int,int,int> > v;
vector<long long> pref, suff;
priority_queue<int> pq;
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> x >> y >> z;
	n = x+y+z;
	pref.assign(n, -INF);
	suff.assign(n, -INF);
	for(int i = 0, a, b, c; i < n; i++) {
		cin >> a >> b >> c;
		delta += c;
		a -= c; b -= c;
		v.emplace_back(a-b, a, b);
	}
	sort(v.begin(), v.end());
	long long sum = 0;
	for(int i = 0; i < n; i++) {
		sum += get<2>(v[i]);
		pq.push(-get<2>(v[i]));
		if(pq.size() > y) sum += pq.top(), pq.pop();
		if(pq.size() == y) pref[i] = sum;
	}
	sum = 0;
	while(!pq.empty()) pq.pop();
	for(int i = n-1; i >= 0; i--) {
		sum += get<1>(v[i]);
		pq.push(-get<1>(v[i]));
		if(pq.size() > x) sum += pq.top(), pq.pop();
		if(pq.size() == x) suff[i] = sum;
	}
	for(int i = 0; i < n-1; i++) ans = max(pref[i]+suff[i+1]+delta, ans);
	cout << ans;
}
