#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <cassert>
#include <complex>
#include <iomanip>
#include <random>

using namespace std;

typedef long long ll;
#define int ll

const int M = 998244353;
#define msum(a, b) ((a) + (b) >= M ? (a) + (b) - M : (a) + (b))
#define msub(a, b) ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b))
#define mmult(a, b) (((a) * (b)) % M)

typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define mmin(a, b) a = min(a, (b))
#define mmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SZ(a) ((int)(a).size())
#define watch(x) cout << (#x) << " = " << (x) << endl;

const double PI = 2 * acos(0.0);
const int oo = 1e9 + 100;
const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


#define N 1001000
vector <pair <int, int> > bc(N), ab(N), ac(N);
vector <int> cpac(N), cpbc(N), apac(N), bpbc(N);

int t[4 * N][4], col[4 * N][4];

void upd(int v, int z, int tl, int tr, int pos, int val, int un)
{
	if (tl == tr)
	{
		t[v][z] = val;
		col[v][z] = un;
	}
	else
	{
		int tm = tl + tr >> 1;
		if (pos <= tm)
			upd(v << 1, z, tl, tm, pos, val, un);
		else
			upd(v << 1 | 1, z, tm + 1, tr, pos, val, un);
		t[v][z] = t[v << 1][z] + t[v << 1 | 1][z];
		col[v][z] = col[v << 1][z] + col[v << 1 | 1][z];
	}
}

int get(int v, int z, int tl, int tr, int cl)
{
	if (cl == 0)
		return 0;
	if (col[v][z] == cl)
	{
		return t[v][z];
	}
	else
	{
		int tm = tl + tr >> 1;
		if (col[v << 1][z] >= cl)
			return get(v << 1, z, tl, tm, cl);
		else
			return get(v << 1 | 1, z, tm + 1, tr, cl - col[v << 1][z]) + t[v << 1][z];
	}
}



signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);

	int x, y, z; cin >> x >> y >> z;
	int n = x + y + z;

	vi a(n), b(n), c(n);
	ab.resize(n);
	ac.resize(n);
	bc.resize(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i] >> b[i] >> c[i];
		ab[i] = { a[i] - b[i], i };
		ac[i] = { a[i] - c[i], i };
		bc[i] = { b[i] - c[i], i };
	}

	sort(ALL(ac));
	sort(RALL(ab));
	sort(ALL(bc));

	for (int i = 0; i < n; i++)
	{
		cpac[ac[i].second] = i;
		cpbc[bc[i].second] = i;
	}

	reverse(ALL(ac));
	reverse(ALL(bc));

	for (int i = 0; i < n; i++)
	{
		apac[ac[i].second] = i;
		bpbc[bc[i].second] = i;
	}


	for (int i = 0; i < n; i++)
	{
		if (i < x)
		{
			upd(1, 0, 0, n - 1, cpac[ab[i].second], c[ab[i].second], 1);
			upd(1, 1, 0, n - 1, apac[ab[i].second], a[ab[i].second], 1);
		}
		else
		{
			upd(1, 2, 0, n - 1, cpbc[ab[i].second], c[ab[i].second], 1);
			upd(1, 3, 0, n - 1, bpbc[ab[i].second], b[ab[i].second], 1);
		}
	}
	int mx = 0;
	for (int i = x; i <= x + z; i++)
	{
		int sma = get(1, 1, 0, n - 1, x), smc = get(1, 0, 0, n - 1, i - x), smb = get(1, 3, 0, n - 1, y), smc2 = get(1, 2, 0, n - 1, n - i - y);
		mmax(mx, sma + smb + smc + smc2);
		

		upd(1, 0, 0, n - 1, cpac[ab[i].second], c[ab[i].second], 1);
		upd(1, 1, 0, n - 1, apac[ab[i].second], a[ab[i].second], 1);
		upd(1, 2, 0, n - 1, cpbc[ab[i].second], 0, 0);
		upd(1, 3, 0, n - 1, bpbc[ab[i].second], 0, 0);

	}

	cout << mx;

}


Measured memory_bytes: 101248