#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
#include <deque>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
#include <complex>
#include <cstring>
#include <cassert>
#include <bitset>

using namespace std;
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define repd(i, a, b) for(int i = (a); i > (b); i--)
#define forIt(it, a) for(__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define forRev(it, a) for(__typeof((a).rbegin()) it = (a).rbegin(); it != (a).rend(); it++)
#define ft(a) __typeof((a).begin())
#define ll long long
#define ld long double
#define fi first
#define se second
#define mk make_pair
#define pb push_back
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define Rep(i,n) for(int i = 0; i < (n); ++i)
#define bitcount(n) __builtin_popcountll(n)
#define randchar() ((rand() % 26) + 'a')


typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
typedef vector<ii> vii;
typedef vector<iii> viii;

const int N = 100000 + 7;
const int M = 20000007;
const int inf = 1e9 + 7;
const long long linf = 1ll * inf * (inf - 1);
const double pi = acos(-1);
const double eps = 1e-7;
const bool multipleTest = 0;

int A, B, C;
ll a[N], b[N], c[N];
int id[N];

bool cmp(int i, int j) {
	return mk(b[i], c[i]) < mk(b[j], c[j]);
}

ll dp[N];
int n;

void calc() {
	// 1->n
	set<pair<ll, int>> other, now;
	ll tol = 0;
	for (int i = 1; i <= n - B; ++i) {
		now.insert(mk(c[id[i - 1]], i));
		tol += c[id[i - 1]];
	}
	while (now.size() > C) {
		other.insert(*now.begin());
		tol -= now.begin()->first;
		now.erase(now.begin());
	}
	
	dp[n - B] = tol;
	
	for (int i = n - B - 1, j = 1; i >= n - B - C; --i, ++j) {
		if (now.count(mk(c[id[i]], i + 1))) {
			now.erase(mk(c[id[i]], i + 1));
			tol -= c[id[i]];
		}
		while (now.size() > C - j) {
			tol -= now.begin()->first;
			now.erase(now.begin());
		}
		dp[i] = tol;
	}
	
//	cout << dp[n - B] << '\n';
	
	assert(dp[n - B - C] == 0);
}

void solve() {
	cin >> A >> B >> C;
	n = A + B + C;
	ll tol = 0;
	for (int i = 0; i < n; ++i) {
		scanf("%lld%lld%lld", a + i, b + i, c + i);
		tol += a[i];
		b[i] -= a[i];
		c[i] -= a[i];
		id[i] = i;
	}
	
	ll finalRes = -linf;
	sort(id, id + n, cmp);
	
	calc();
	
	priority_queue<ll> other, now;
	ll curB = 0;
	for (int i = n - 1; i >= n - B; --i) {
		other.push(c[id[i]] - b[id[i]]);
		curB += b[id[i]];
//		cout << dp[i] << '\n';
	}
	
	finalRes = max(finalRes, tol + curB + dp[n - B]);
	
	ll maxC = 0;
	
	for (int i = n - B - 1, j = 1; i >= n - B - 1 - C; --i, ++j) {
		curB += b[id[i]];
		if (c[id[i]] - b[id[i]] >= other.top()) {
			now.push(c[id[i]] - b[id[i]]);
			maxC += c[id[i]] - b[id[i]];
		} else {
			maxC += other.top();
			now.push(other.top());
			other.pop();
			other.push(c[id[i]] - b[id[i]]);
		}
		
		
		finalRes = max(finalRes, tol + curB + maxC + dp[i]);
	}
	
	cout << finalRes;
}

int main() {
#ifdef _LOCAL_
	freopen("in.txt", "r", stdin);
#endif
	//	freopen("out.txt", "w", stdout);
	// 	ios_base::sync_with_stdio(false);
	// 	cin.tie(NULL);
	
	//	setbuf(stdout, NULL);
	
	int Test = 1;
	if (multipleTest) {
		cin >> Test;
	}
	for(int i = 0; i < Test; ++i) {
		//		printf("Case #%d\n", i + 1);
		//		cout << "Case #" << i + 1 << '\n';
		solve();
	}
	
#ifdef _LOCAL_
	cout<<"\n" << 1.0 * clock() / CLOCKS_PER_SEC<<endl;
#endif
}


Measured memory_bytes: 9600