#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
typedef long long LL;
typedef pair<int, int> PII;

int x, y, z, n;
int a[100000], b[100000], c[100000];
int ab[100000], ac[100000], ba[100000], bc[100000], ca[100000], cb[100000];

struct AB { inline bool operator()(const int &lhs, const int &rhs) const { return ab[lhs] != ab[rhs] ? ab[lhs] < ab[rhs] : lhs < rhs; } };
struct AC { inline bool operator()(const int &lhs, const int &rhs) const { return ac[lhs] != ac[rhs] ? ac[lhs] < ac[rhs] : lhs < rhs; } };
struct BA { inline bool operator()(const int &lhs, const int &rhs) const { return ba[lhs] != ba[rhs] ? ba[lhs] < ba[rhs] : lhs < rhs; } };
struct BC { inline bool operator()(const int &lhs, const int &rhs) const { return bc[lhs] != bc[rhs] ? bc[lhs] < bc[rhs] : lhs < rhs; } };
struct CA { inline bool operator()(const int &lhs, const int &rhs) const { return ca[lhs] != ca[rhs] ? ca[lhs] < ca[rhs] : lhs < rhs; } };
struct CB { inline bool operator()(const int &lhs, const int &rhs) const { return cb[lhs] != cb[rhs] ? cb[lhs] < cb[rhs] : lhs < rhs; } };
set<int, AB> sab;
set<int, AC> sac;
set<int, BA> sba;
set<int, BC> sbc;
set<int, CA> sca;
set<int, CB> scb;

int main() {
    scanf("%d%d%d", &x, &y, &z);
    n = x + y + z;
    forn(i, n) scanf("%d%d%d", a + i, b + i, c + i);
    forn(i, n) {
        ab[i] = a[i] - b[i];
        ac[i] = a[i] - c[i];
        ba[i] = b[i] - a[i];
        bc[i] = b[i] - c[i];
        ca[i] = c[i] - a[i];
        cb[i] = c[i] - b[i];
    }
    LL ans = 0;
    forn(i, x) {
        sab.insert(i);
        sac.insert(i);
        ans += a[i];
    }
    forn(i, y) {
        sba.insert(x + i);
        sbc.insert(x + i);
        ans += b[x + i];
    }
    forn(i, z) {
        sca.insert(x + y + i);
        scb.insert(x + y + i);
        ans += c[x + y + i];
    }
    while (true) {
        bool done = true;

        if (ab[*sab.begin()] + ba[*sba.begin()] < 0) {
            int ai = *sab.begin();
            int bi = *sba.begin();
            sab.erase(ai);
            sac.erase(ai);
            sba.erase(bi);
            sbc.erase(bi);
            ans -= ab[ai] + ba[bi];
            sab.insert(bi);
            sac.insert(bi);
            sba.insert(ai);
            sbc.insert(ai);
            done = false;
        }

        if (ac[*sac.begin()] + ca[*sca.begin()] < 0) {
            int ai = *sac.begin();
            int ci = *sca.begin();
            sab.erase(ai);
            sac.erase(ai);
            sca.erase(ci);
            scb.erase(ci);
            ans -= ac[ai] + ca[ci];
            sab.insert(ci);
            sac.insert(ci);
            sca.insert(ai);
            scb.insert(ai);
            done = false;
        }

        if (bc[*sbc.begin()] + cb[*scb.begin()] < 0) {
            int bi = *sbc.begin();
            int ci = *scb.begin();
            sba.erase(bi);
            sbc.erase(bi);
            sca.erase(ci);
            scb.erase(ci);
            ans -= bc[bi] + cb[ci];
            sba.insert(ci);
            sbc.insert(ci);
            sca.insert(bi);
            scb.insert(bi);
            done = false;
        }

        if (ab[*sab.begin()] + bc[*sbc.begin()] + ca[*sca.begin()] < 0) {
            int ai = *sab.begin();
            int bi = *sbc.begin();
            int ci = *sca.begin();
            sab.erase(ai);
            sac.erase(ai);
            sba.erase(bi);
            sbc.erase(bi);
            sca.erase(ci);
            scb.erase(ci);
            ans -= (LL)ab[ai] + bc[bi] + ca[ci];
            sab.insert(ci);
            sac.insert(ci);
            sba.insert(ai);
            sbc.insert(ai);
            sca.insert(bi);
            scb.insert(bi);
            done = false;
        }

        if (ac[*sac.begin()] + cb[*scb.begin()] + ba[*sba.begin()] < 0) {
            int ai = *sac.begin();
            int ci = *scb.begin();
            int bi = *sba.begin();
            sab.erase(ai);
            sac.erase(ai);
            sba.erase(bi);
            sbc.erase(bi);
            sca.erase(ci);
            scb.erase(ci);
            ans -= (LL)ac[ai] + cb[ci] + ba[bi];
            sab.insert(bi);
            sac.insert(bi);
            sba.insert(ci);
            sbc.insert(ci);
            sca.insert(ai);
            scb.insert(ai);
            done = false;
        }

        if (done) {
            break;
        }
    }
//    for (int i : sab) cerr << i << ' ';
//    cerr << endl;
//    for (int i : sba) cerr << i << ' ';
//    cerr << endl;
//    for (int i : sca) cerr << i << ' ';
//    cerr << endl;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 13184