// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;

const ll N = 1e5 + 100, inF = 1e17;

ll A, B, C, n, a[N], b[N], c[N], dex[N], up[N], down[N];



int main() {

	ios::sync_with_stdio(false), cin.tie(0);

	cin >> A >> B >> C;

	n = A + B + C;

	for (int i = 0; i < n; i++)

		cin >> a[i] >> b[i] >> c[i];

	iota(dex, dex + n, 0);

	sort(dex, dex + n, [](int x, int y) {

		return c[x] - b[x] < c[y] - b[y];

	});

	// a - b

	fill(up, up + N, -inF);

	multiset<ll> st;

	ll now = 0;

	for (int i = 0; i < B; i++) {

		int ind = dex[i];

		st.insert(a[ind] - b[ind]);

		now += b[ind];

	}

	if(B)

		up[B - 1] = now;

	for (int i = B; i < n; i++) {

		int ind = dex[i];

		if(B == 0) {

			now += a[ind];

			up[i] = now;

			continue;

		}

		if(a[ind] - b[ind] > (*st.rbegin()))

			now += a[ind];

		else {

			ll val = *st.rbegin();

			st.erase(st.find(val));

			now += val;

			now += b[ind];

			st.insert(a[ind] - b[ind]);

		}

		up[i] = now;

	}

	// a - c

	fill(down, down + N, -inF);

	st.clear();

	now = 0;

	for (int i = 0; i < C; i++) {

		int ind = dex[n - i -1];

		st.insert(a[ind] - c[ind]);

		now += c[ind];

	}

	down[n - C] = now;

	for (int i = C; i < n; i++) {

		int ind = dex[n - i - 1];

		if(C == 0) {

			now += a[ind];

			down[i] = now;

			continue;

		}

		if(a[ind] - c[ind] > (*st.rbegin()))

			now += a[ind];

		else {

			ll val = *st.rbegin();

			st.erase(st.find(val));

			now += val;

			now += c[ind];

			st.insert(a[ind] - c[ind]);

		}

		down[n - i - 1] = now;

	}

	ll ans = 0;

	for (int i = 0; i < n - 1; i++)

		ans = max(ans, up[i] + down[i + 1]);

	cout << ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.651033940199606x):
/*

 　　　　　／＞　 フ

 　　　　　| 　_　 _|

 　 　　　／`ミ _x 彡

 　　 　 /　　　 　 |

 　　　 /　  ヽ　　 ?

 　／￣|　　 |　|　|

 　| (￣ヽ＿_ヽ_)_)

 　＼二つ

*/



#include <queue>

#include <vector>

#include <iostream>

#include <cstdio>

#include <cstring>

#include <algorithm>

#define MP make_pair

#define ll long long

#define fi first

#define se second

using namespace std;



template <typename T>

void read(T &x) {

    x = 0; bool f = 0;

    char c = getchar();

    for (;!isdigit(c);c=getchar()) if (c=='-') f=1;

    for (;isdigit(c);c=getchar()) x=x*10+(c^48);

    if (f) x=-x;

}



template<typename F>

inline void write(F x, char ed = '\n') {

    static short st[30];short tp=0;

    if(x<0) putchar('-'),x=-x;

    do st[++tp]=x%10,x/=10; while(x);

    while(tp) putchar('0'|st[tp--]);

    putchar(ed);

}



template <typename T>

inline void Mx(T &x, T y) { x < y && (x = y); }



template <typename T>

inline void Mn(T &x, T y) { x > y && (x = y); }



%:define Pa pair<int, int> 

const int N = 105000;

const int inf = 1e9;

priority_queue<Pa> q1, q2, q3, q4;

int x[N], y[N], z[N];

int vis[N], A, B, C, n;



Pa get(priority_queue<Pa> &q) { while (vis[q.top().se]) q.pop(); return q.top(); }



int main() {

    read(A), read(B), read(C), n = A + B + C; ll ans = 0;

    for (int i = 1;i <= n; i++) {

        read(x[i]), read(y[i]), read(z[i]);

        ans += z[i], x[i] -= z[i], y[i] -= z[i];

        q1.push(MP(x[i], i)), q2.push(MP(y[i], i));

    }

    /* write(ans); */

    /* for (int i = 1;i <= n; i++) write(x[i], ' '), write(y[i]); */

    while (A || B) {

        Pa t1 = get(q1), t2 = get(q2);

        if (!A) { q3.empty() ? t1.fi = -inf : t1.fi += q3.top().fi; }

        if (!B) { q4.empty() ? t2.fi = -inf : t2.fi += q4.top().fi; }

        if (t1.fi > t2.fi) {

            vis[t1.se] = 1, ans += t1.fi;

            if (A) A--;

            else { B--; Pa t = q3.top(); q3.pop(); q4.push(MP(-t.fi, t.se)); }

            q3.push(MP(y[t1.se] - x[t1.se], t1.se));

        }

        else {

            vis[t2.se] = 1, ans += t2.fi;

            if (B) B--;

            else { A--; Pa t = q4.top(); q4.pop(); q3.push(MP(-t.fi, t.se)); }

            q4.push(MP(x[t2.se] - y[t2.se], t2.se));

        }

    }

    write(ans);

    return 0;

}