#include <bits/stdc++.h>

using namespace std;

const int maxn = 100000 + 5;
const long long INF = 1e18;
typedef long long LL;

struct node {
    int A, B, C;
}p[maxn];
bool cmp(node a, node b) {
    return a.A - a.B < b.A - b.B;
}
int N, X, Y, Z;
LL res = 0;
priority_queue<int, vector<int>, greater<int> > q;
LL pre[maxn], suf[maxn];
int main() {
    scanf("%d%d%d", &X, &Y, &Z);
    N = X + Y + Z;
    for(int i = 1; i <= N; i++) scanf("%d%d%d", &p[i].A, &p[i].B, &p[i].C);

    sort(p + 1, p + N + 1, cmp);

    for(int i = 1; i <= N; i++) {
        res += p[i].C;
        p[i].A -= p[i].C;
        p[i].B -= p[i].C;
    }
    for(int i = 1; i <= N; i++) {
        pre[i] = pre[i - 1] + p[i].B;
        q.push(p[i].B);
        if(q.size() > Y) pre[i] -= q.top(), q.pop();
    }
    while(!q.empty()) q.pop();
    for(int i = N; i; --i) {
        suf[i] = suf[i + 1] + p[i].A;
        q.push(p[i].A);
        if(q.size() > X) suf[i] -= q.top(), q.pop();
    }
    LL tmp = -INF;
    for(int i = Y; i <= N - X; i++) tmp = max(tmp, pre[i] + suf[i + 1]);
    printf("%lld\n", res + tmp);
    return 0;
}
