#include <iostream>
#include <algorithm>
#include <queue>
using namespace std;

#define int long long

typedef pair<int, int> ii;

const int N = 1e5 + 5;

int X, Y, Z, a[N], b[N], c[N], ans, l[N], r[N], val, p[N];
priority_queue<int, vector<int>, greater<int> > pq;

bool cmp(int u, int v) {
	return (a[u] + b[v] > a[v] + b[u] || (a[u] + b[v] == a[v] + b[u] && u > v));
}

signed main() {
	cin >> X >> Y >> Z;
	for(int i = 1; i <= X + Y + Z; ++i) {
		cin >> a[i] >> b[i] >> c[i];
		ans += c[i];
	}
	for(int i = 1; i <= X + Y + Z; ++i) p[i] = i;
	sort(p + 1, p + X + Y + Z + 1, cmp);
	for(int i = 1; i <= X + Y + Z; ++i) a[i] -= c[i], b[i] -= c[i];
	for(int k = 1; k <= X + Y + Z; ++k) {
		int i = p[k];
		l[k] = -1e18;
		pq.push(a[i]); val += a[i];
		if(pq.size() > X) {
			val -= pq.top();
			pq.pop();
		}
		if(pq.size() >= X) l[k] = val;
	}
	while(pq.size()) pq.pop(); val = 0;
	for(int k = X + Y + Z; k >= 1; --k) {
		int i = p[k];
		r[k] = -1e18;
		pq.push(b[i]); val += b[i];
		if(pq.size() > Y) {
			val -= pq.top();
			pq.pop();
		}
		if(pq.size() >= Y) r[k] = val;
	}
	val = -1e18; l[0] = -1e18; r[X + Y + Z + 1] = -1e18;
	for(int i = 0; i <= X + Y + Z; ++i) val = max(val, l[i] + r[i + 1]);
	cout << val + ans;
}