#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <utility>
#include <cstdlib>
#include <memory>
#include <queue>
#include <cassert>
#include <cmath>
#include <ctime>
#include <complex>
#include <bitset>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <numeric>

using namespace std;

#define ws ws_____________________
#define y1 y1_____________________
#define y0 y0_____________________
#define left left_________________
#define right right_______________
#define next next_________________
#define prev prev_________________
#define hash hash_________________

#define pb push_back
#define fst first
#define snd second
#define mp make_pair 
#define sz(C) ((int) (C).size())
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; --i)
#define all(C) begin(C), end(C)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef long double ld;
typedef complex<double> cd;

#ifdef LOCAL
#define eprintf(args...) fprintf(stderr, args), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define FILE_NAME "a"

struct Person {
	int a, b, c;

	void read() {
		scanf("%d%d%d", &a, &b, &c);
	}

	void print() const {
		eprintf("%d %d %d\n", a, b, c);
	}
};

int X, Y, Z;
vector<Person> p;
int n;

bool read() {
	if  (scanf("%d%d%d", &X, &Y, &Z) < 3) {
		return 0;
	}
	n = X + Y + Z;
	p.resize(n);
	forn(i, n) {
		p[i].read();
	}
	return 1;
}

struct AvsB {
	bool operator()(const Person& p1, const Person& p2) {
		return p1.a - p1.b > p2.a - p2.b;
	}
};

struct CvsB {
	bool operator()(const Person& p1, const Person& p2) {
		return p1.c - p1.b > p2.c - p2.b;
	}
};

struct CvsA {
	bool operator()(const Person& p1, const Person& p2) {
		return p1.c - p1.a > p2.c - p2.a;
	}
};

const ll INF = 1e18;

template<typename Cmp, typename F1, typename F2>
vll calc(const vector<Person>& p, int cnt1, Cmp, F1 f1, F2 f2) {
	multiset<Person, Cmp> S;
	ll sum1 = 0;
	ll sum2 = 0;
	vll pref(sz(p));
	forn(i, sz(p)) {
		S.insert(p[i]);
		sum1 += f1(p[i]);
		if  (sz(S) > cnt1) {
			auto mn = *S.begin();
			sum2 += f2(mn);
			sum1 -= f1(mn);
			S.erase(S.find(mn));
		}

		if  (sz(S) == cnt1) {
			pref[i] = sum1 + sum2;
		} else {
			pref[i] = -INF;
		}
	}
	return pref;
}

ll solve() {
	sort(all(p), AvsB());

	// for (auto x : p) {
	// 	x.print();
	// }

	vll pref = calc(p, X, CvsA(), [](const Person& p) { return p.a; }, [](const Person& p) { return p.c; });

	reverse(all(p));
	vll suff = calc(p, Y, CvsB(), [](const Person& p) { return p.b; }, [](const Person& p) { return p.c; });
	reverse(all(suff));
	reverse(all(p));

	ll ans = 0;
	forn(i, n - 1) {
		if  (pref[i] <= -INF || suff[i + 1] <= -INF) {
			continue;
		}
		ll cur = pref[i] + suff[i + 1];
		ans = max(ans, cur);
	}

	return ans;
}

int main() {
#ifdef LOCAL
	freopen(FILE_NAME ".in", "r", stdin);
	// freopen(FILE_NAME ".out", "w", stdout);
#endif

	while (read()) {
		printf("%lld\n", solve());
	}

#ifdef LOCAL
	cerr.precision(5);
	cerr << "Time: " << fixed << (double) clock() / CLOCKS_PER_SEC << endl;
#endif
	return 0;
}


Measured memory_bytes: 8832