#include <bits/stdc++.h>

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define SIZE(c) (int) (c).size()
#define FORE(i,c) FOR(i,0,SIZE(c)-1)
#define FORDE(i,c) FORD(i,SIZE(c)-1,0)

#define pb push_back
#define mp make_pair
#define st first
#define nd second


using namespace std;

typedef long long ll;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;

typedef vector <int> VI;
typedef vector <bool> VB;
typedef vector <pii> VP;
typedef vector <ll> VL;
typedef vector <pll> VPL;

typedef vector <VI> VVI;
typedef vector <VL> VVL;
typedef vector <VB> VVB;
typedef vector <VP> VVP;

const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000000000000001LL;

struct ITree {
    typedef ll val_t;

    vector <val_t> T;
    int p = 1;

    ITree(int n) {
        while (p < n) p *= 2;
        T.resize(2*p-1,0);
    }

    int par(int x) { return (x - 1) / 2; }

    void add(int l, val_t v) {
        l += p-1;
        T[l] += v;

        while (l > 0) {
            l = par(l);
            T[l] += v;
        }
    }

    val_t query(int l, int r) {
        if (l > r) return 0;
    
        l += p-1; r += p-1;

        val_t ans = T[l];
        if (l < r) ans += T[r];

        while (par(l) != par(r)) {
            if (l%2 == 1) ans += T[l+1];
            if (r%2 == 0) ans += T[r-1];

            l = par(l);
            r = par(r);
        }

        return ans;
    }
    
    int prefWithSum(int v, int sum) {
        if (v >= p-1) {
            return v - p + 1;
        }
        
        int l = 2 * v + 1;
        int r = 2 * v + 2;
        
        if (T[l] >= sum) {
            return prefWithSum(l, sum);
        } else {
            return prefWithSum(r, sum - T[l]);
        }
    }
    
    int prefWithSum(int sum) {
        return prefWithSum(0, sum);
    }
};

/*************************************************************************/

struct elem {
    ll a, b;
    int pos;
    
    bool operator<(const elem &other) const {
        if (b != other.b) {
            return b > other.b;
        } else {
            return pos < other.pos;
        }
    }
};

ll solve(int x, int y, int z, int n, VL &a, VL &b) {
    vector <elem> elems(n);
    FOR(i,0,n-1) {
        elems[i] = {a[i], b[i], -1};
    }
    
    sort(elems.begin(), elems.end(), [](elem p, elem q) {
        return p.a - p.b > q.a - q.b;
    });
    
    FORE(i,elems) {
        elems[i].pos = i;
    }
    
    sort(elems.begin(), elems.end(), [](elem p, elem q) {
        return mp(p.a, p.b) < mp(q.a, q.b);
    });
    
    set <elem> inZ;
    ll ans = -LINF;
    
    ITree treePresent(n);
    ITree treeA(n), treeB(n);
    
    for (auto &e : elems) {
        treePresent.add(e.pos, 1);
        treeA.add(e.pos, e.a);
        treeB.add(e.pos, e.b);
    }
    
    for (auto &e : elems) {
        inZ.insert(e);
        
        treePresent.add(e.pos, -1);
        treeA.add(e.pos, -e.a);
        treeB.add(e.pos, -e.b);
        
        if (inZ.size() > z) {
            auto e = *inZ.begin();
            
            inZ.erase(inZ.begin());
            
            treePresent.add(e.pos, 1);
            treeA.add(e.pos, e.a);
            treeB.add(e.pos, e.b);
        }
        
        if (inZ.size() == z) {
            ll ansHere = 0;
            
            int cutoff = treePresent.prefWithSum(x);
            
            ansHere += treeA.query(0, cutoff);
            ansHere += treeB.query(cutoff + 1, n - 1);
            
            ans = max(ans, ansHere);
        }
    }
    
    return ans;
}

/*************************************************************************/

int main() {
    ios_base::sync_with_stdio(0);
    
    int x, y, z;
    cin >> x >> y >> z;
    
    int n = x + y + z;
    
    VL a(n), b(n);
    ll add = 0;
    
    FOR(i,0,n-1) {
        ll ai, bi, ci;
        cin >> ai >> bi >> ci;
        
        a[i] = ai - ci;
        b[i] = bi - ci;
        
        add += ci;
    }
    
    cout << solve(x, y, z, n, a, b) + add;

    return 0;
}

/*************************************************************************/


Measured memory_bytes: 14336