#include <bits/stdc++.h>
using namespace std;
int x, y, z, n;
const int N = 200000;
#define LL long long
int ai[N], bi[N], ci[N], ord[N];
int comp(int u, int v)
{
    return ai[u] - bi[u] > ai[v] - bi[v];
}
priority_queue <int> H;
LL pre[N], suc[N], preA[N], sucB[N];
LL ans;
int main()
{
    scanf("%d%d%d", &x, &y, &z); n = x + y + z;
    for (int i = 1; i <= n; ++ i)
        scanf("%d%d%d", &ai[i], &bi[i], &ci[i]);
    for (int i = 1; i <= n; ++ i) ord[i] = i;
    sort(ord + 1, ord + n + 1, comp);
    for (int i = 1; i <= x; ++ i) H.push(ci[ord[i]] - ai[ord[i]]);
    for (int i = x + 1; i <= n - y; ++ i)
    {
        H.push(ci[ord[i]] - ai[ord[i]]);
        int v = H.top(); H.pop();
        pre[i] = pre[i - 1] + v;
    }
    while (!H.empty()) H.pop();
    for (int i = n; i > n - y; -- i) H.push(ci[ord[i]] - bi[ord[i]]);
    for (int i = n - y; i > x; -- i)
    {
        H.push(ci[ord[i]] - bi[ord[i]]);
        int v = H.top(); H.pop();
        suc[i] = suc[i + 1] + v;
    }
    for (int i = 1; i <= n; ++ i) preA[i] = preA[i - 1] + ai[ord[i]];
    for (int i = n; i >= 1; -- i) sucB[i] = sucB[i + 1] + bi[ord[i]];
    for (int i = x; i <= n - y; ++ i) ans = max(ans, preA[i] + pre[i] + sucB[i + 1] + suc[i + 1]);
    printf("%lld\n", ans);
}
