#include <bits/stdc++.h>

#define HEAP priority_queue
#define rep(i, n) for(int i = 0, _end_ = (n); i < _end_; ++i)
#define per(i, n) for(int i = (n) - 1; i >= 0 ; --i)
#define forn(i, l, r) for(int i = (l), _end_ = (r); i <= _end_; ++i)
#define nrof(i, r, l) for(int i = (r), _end_ = (l); i >= _end_; --i)
#define FOR(a, b) for(auto (a): (b))
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define X first
#define Y second
#define eps 1e-6
#define pi 3.1415926535897932384626433832795
#define SZ(x) (int)x.size()
#define ALL(x) x.begin(), x.end()

using namespace std;

typedef long long LL;
typedef double flt;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef pair<int,int> pii;
typedef pair<int,LL> pil;
typedef pair<LL,int> pli;
typedef pair<LL,LL> pll;
typedef vector<pil> vil;
typedef vector<pii> vii;
typedef vector<pli> vli;
typedef vector<pll> vll;

const int iinf = 1e9 + 7;
const int oo = 0x3f3f3f3f;
const LL linf = 1ll << 60;
const flt dinf = 1e60;

template <typename T> inline void scf(T &x)
{
    bool f = 0;
    x = 0;
    char c = getchar();
    while(c != '-' && (c < '0' || c > '9')) c = getchar();
    if(c == '-') f = 1, c = getchar();
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    if(f) x = -x;
    return;
}

template <typename T1, typename T2> void scf(T1 &x, T2 &y)
{
    scf(x);
    return scf(y);
}

template <typename T1, typename T2, typename T3> void scf(T1 &x, T2 &y, T3 &z)
{
    scf(x);
    scf(y);
    return scf(z);
}

template <typename T1, typename T2, typename T3, typename T4> void scf(T1 &x, T2 &y, T3 &z, T4 &w)
{
    scf(x);
    scf(y);
    scf(z);
    return scf(w);
}

inline char mygetchar()
{
    char c = getchar();
    while(c == ' ' || c == '\n') c = getchar();
    return c;
}

template <typename T> inline bool chkmax(T &x, const T &y)
{
    return y > x ? x = y, 1 : 0;
}

template <typename T> inline bool chkmin(T &x, const T &y)
{
    return y < x ? x = y, 1 : 0;
}

#ifdef DEBUG
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

//---------------------------------------------------------head----------------------------------------------------

const int maxn = 1e5 + 100;

int X, Y, Z, n;
LL ans, mx, sum;
pll a[maxn];
pli b[maxn], num[maxn];
HEAP<LL> heap;

int lowbit(int i) {
    return i & (-i);
}

pli operator +(const pli &a, const pli &b) {
    return mp(a.X + b.X, a.Y + b.Y);
}

void M(int i, pli x) {
    //printf("M(%d, %lld, %d)\n", i, x.X, x.Y);
    for (; i <= n; i += lowbit(i)) {
        num[i] = num[i] + x;
    }
    return;
}

LL Q(int n) {
    LL x = 0;
    int i = 0;
    for (int lg = 65536; lg; lg >>= 1) {
        //printf("\t\t\t%d %d %d %d\n", i, lg, num[i | lg].Y, n);
        if((i | lg) <= ::n && num[i | lg].Y <= n) {
            i |= lg;
            n -= num[i].Y;
            x += num[i].X;
        }
    }
    //printf("%d %d %lld\n", i, n, x);
    return x;
}

int F(pli x) {
    return n - (lower_bound(b, b + n, x) - b);
}

int main()
{
    scf(X, Y, Z);
    n = X + Y + Z;
    rep(i, n) {
        LL u, v, w;
        scf(u, v, w);
        ans += u;
        a[i] = mp(v - u, w - u);
    }
    sort(a, a + n);
    reverse(a, a + n);
    rep(i, n) {
//        printf("%lld %lld\n", a[i].X, a[i].Y);
        b[i] = mp(a[i].Y, i);
    }
    sort(b, b + n);
    forn(i, Y, n - 1) {
        M(F(mp(a[i].Y, i)), mp(a[i].Y, 1));
    }
    rep(i, Y) {
        heap.push(a[i].Y - a[i].X);
        sum += a[i].X;
    }
    mx = sum + Q(Z);
    forn(i, Y, n - 1) {
        --Z;
        if(!~Z) {
            break;
        }
        sum += heap.top();
        heap.pop();
        sum += a[i].X;
        heap.push(a[i].Y - a[i].X);
        M(F(mp(a[i].Y, i)), mp(-a[i].Y, -1));
//        printf("\t%d %d %lld %lld\n", i, Z, sum, Q(Z));
        chkmax(mx, sum + Q(Z));
    }
    printf("%lld\n", ans + mx);
    return 0;
}


Measured memory_bytes: 5628