#include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

int X, Y, Z, A[100000], B[100000], C[100000];
ll res;
set<pair<int, int>>Ab, Ba, Bc, Cb, Ca, Ac;
int main() {
	cin >> X >> Y >> Z;
	for (int i = 0; i < X + Y + Z; ++i) {
		cin >> A[i] >> B[i] >> C[i];
	}
	for (int i = 0; i < X; ++i) {
		res += A[i];
		Ab.insert(mkp(A[i] - B[i], i));
		Ac.insert(mkp(A[i] - C[i], i));
	}
	for (int i = X; i < X + Y; ++i) {
		res += B[i];
		Ba.insert(mkp(B[i] - A[i], i));
		Bc.insert(mkp(B[i] - C[i], i));
	}
	for (int i = X + Y; i < X + Y + Z; ++i) {
		res += C[i];
		Ca.insert(mkp(C[i] - A[i], i));
		Cb.insert(mkp(C[i] - B[i], i));
	}
	while (1) {
		if (Ab.begin()->first + Ba.begin()->first < 0) {
			res -= Ab.begin()->first + Ba.begin()->first;
			int p = Ab.begin()->second;
			int q = Ba.begin()->second;
			Ab.erase(mkp(A[p] - B[p], p));
			Ac.erase(mkp(A[p] - C[p], p));
			Ba.erase(mkp(B[q] - A[q], q));
			Bc.erase(mkp(B[q] - C[q], q));
			Ab.insert(mkp(A[q] - B[q], q));
			Ac.insert(mkp(A[q] - C[q], q));
			Ba.insert(mkp(B[p] - A[p], p));
			Bc.insert(mkp(B[p] - C[p], p));
		}
		else if (Ac.begin()->first + Ca.begin()->first < 0) {
			res -= Ac.begin()->first + Ca.begin()->first;
			int p = Ac.begin()->second;
			int q = Ca.begin()->second;
			Ab.erase(mkp(A[p] - B[p], p));
			Ac.erase(mkp(A[p] - C[p], p));
			Ca.erase(mkp(C[q] - A[q], q));
			Cb.erase(mkp(C[q] - B[q], q));
			Ab.insert(mkp(A[q] - B[q], q));
			Ac.insert(mkp(A[q] - C[q], q));
			Ca.insert(mkp(C[p] - A[p], p));
			Cb.insert(mkp(C[p] - B[p], p));
		}
		else if (Bc.begin()->first + Cb.begin()->first < 0) {
			res -= Bc.begin()->first + Cb.begin()->first;
			int p = Bc.begin()->second;
			int q = Cb.begin()->second;
			Ba.erase(mkp(B[p] - A[p], p));
			Bc.erase(mkp(B[p] - C[p], p));
			Ca.erase(mkp(C[q] - A[q], q));
			Cb.erase(mkp(C[q] - B[q], q));
			Ba.insert(mkp(B[q] - A[q], q));
			Bc.insert(mkp(B[q] - C[q], q));
			Ca.insert(mkp(C[p] - A[p], p));
			Cb.insert(mkp(C[p] - B[p], p));

		}
		else if (Ab.begin()->first + Bc.begin()->first + Ca.begin()->first < 0) {
			res -= Ab.begin()->first + Bc.begin()->first + Ca.begin()->first;
			int p = Ab.begin()->second;
			int q = Bc.begin()->second;
			int r = Ca.begin()->second;
			Ab.erase(mkp(A[p] - B[p], p));
			Ac.erase(mkp(A[p] - C[p], p));
			Ba.erase(mkp(B[q] - A[q], q));
			Bc.erase(mkp(B[q] - C[q], q));
			Ca.erase(mkp(C[r] - A[r], r));
			Cb.erase(mkp(C[r] - B[r], r));

			Ab.insert(mkp(A[r] - B[r], r));
			Ac.insert(mkp(A[r] - C[r], r));
			Ba.insert(mkp(B[p] - A[p], p));
			Bc.insert(mkp(B[p] - C[p], p));
			Ca.insert(mkp(C[q] - A[q], q));
			Cb.insert(mkp(C[q] - B[q], q));
		}
		else if (Ac.begin()->first + Ba.begin()->first + Cb.begin()->first < 0) {
			res -= Ac.begin()->first + Ba.begin()->first + Cb.begin()->first;
			int p = Ac.begin()->second;
			int q = Ba.begin()->second;
			int r = Cb.begin()->second;
			Ab.erase(mkp(A[p] - B[p], p));
			Ac.erase(mkp(A[p] - C[p], p));
			Ba.erase(mkp(B[q] - A[q], q));
			Bc.erase(mkp(B[q] - C[q], q));
			Ca.erase(mkp(C[r] - A[r], r));
			Cb.erase(mkp(C[r] - B[r], r));

			Ab.insert(mkp(A[q] - B[q], q));
			Ac.insert(mkp(A[q] - C[q], q));
			Ba.insert(mkp(B[r] - A[r], r));
			Bc.insert(mkp(B[r] - C[r], r));
			Ca.insert(mkp(C[p] - A[p], p));
			Cb.insert(mkp(C[p] - B[p], p));
		}
        else break;
	}

	cout << res << endl;
}


Measured memory_bytes: 10752