#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <deque>
#include <queue>
#include <cstring>
#include <set>
#include <list>
#include <map>
#include <random>
#include <unordered_map>
#include <stdio.h>

using namespace std;

typedef long long ll;
typedef std::vector<int> vi;
typedef std::vector<bool> vb;
typedef std::vector<string> vs;
typedef std::vector<double> vd;
typedef std::vector<long long> vll;
typedef std::vector<std::vector<int> > vvi;
typedef vector<vvi> vvvi;
typedef vector<vll> vvll;
typedef std::vector<std::pair<int, int> > vpi;
typedef vector<vpi> vvpi;
typedef std::pair<int, int> pi;
typedef std::pair<ll, ll> pll;
typedef std::vector<pll> vpll;

const long long mod = 1000000007;

#define all(c) (c).begin(),(c).end()
#define sz(c) (int)(c).size()
#define forn(i, a, b) for(int i = a; i < b; i++)

#define pb push_back
#define mp make_pair
deque<pair<int, pi>> gs1,sb1,gb1,gs2,sb2,gb2;
const ll INF = 1e18;
ll cnt(int x, int y, vector<pair<int, pi>> & d) {
    int n = d.size();
    vpi pr;
    for(auto el : d) pr.pb(el.second);
    vpi a, b;
    forn(i,0,n) {
        a.pb(mp(pr[i].first, i));
        b.pb(mp(pr[i].second, i));
    }
    sort(all(a));
    reverse(all(a));
    sort(all(b));
    reverse(all(b));
    vi posa(n);
    vi posb(n);
    forn(i,0,n) {
        posa[a[i].second] = i;
        posb[b[i].second] = i;
    }
    vll by2_pref(n,-INF);
    vi ua(n,1);
    vi ub(n,1);
    by2_pref[n-1] = 0;
    forn(i,0,y) {
        by2_pref[n-1] += b[i].first;
        ub[i] = 2;
    }
    int ptb = y;
    for(int i = n-1; i >= y; i--) {
        by2_pref[i-1] = by2_pref[i];
        int toban = posb[i];
        if(ub[toban] == 1) {
            ub[toban] = 0;
        }
        else if(ub[toban] == 2) {
            by2_pref[i-1] -= b[toban].first;
            ub[toban] = 0;
            while(ub[ptb] != 1) ptb++;
            by2_pref[i-1] += b[ptb].first;
            ub[ptb] = 2;
        }
    }
    int pta = x;
    vll bx1_suf(n,-INF);
    bx1_suf[0] = 0;
    forn(i,0,x) {
        bx1_suf[0] += a[i].first;
        ua[i] = 2;
    }
    for(int i = 0; i <= n-1-x; i++) {
        bx1_suf[i+1] = bx1_suf[i];
        int toban = posa[i];
        if(ua[toban] == 1) {
            ua[toban] = 0;
        }
        else if(ua[toban] == 2) {
            bx1_suf[i+1] -= a[toban].first;
            ua[toban] = 0;
            while(ua[pta] != 1) pta++;
            bx1_suf[i+1] += a[pta].first;
            ua[pta] = 2;
        }
    }
    ll res = -INF;
    forn(i,y,n+1-x) {
        ll cur = 0;
        if(i>0) cur += by2_pref[i-1];
        if(i<n) cur += bx1_suf[i];
        res = max(res,cur);
    }
    return res;
}

ll sum(int ot, deque<pair<int, pi>> & d) {
    ll res = 0;
    for(auto x : d) {
        if(ot == 1) res+=x.second.first;
        else res+=x.second.second;
    }
    return res;
}

int x,y,z,n;

ll test (deque<pair<int, pi>> gs, deque<pair<int, pi>> sb, deque<pair<int, pi>> gb) {
    sort(all(sb));
    sort(all(gb));
    sort(all(gs));
    int sbs = sb.size();
    int gbs = gb.size();
    int gss = gs.size();

    vvi cl;
    reverse(all(gs));
    for(auto x : gs) cl.pb(vi({x.second.first, x.second.second, 0}));
    reverse(all(sb));
    for(auto x : sb) cl.pb(vi({0, x.second.first, x.second.second}));
    for(auto x : gb) cl.pb(vi({x.second.first, 0, x.second.second}));
    int st = 0;
    ll cur = 0;
    forn(i,st, st+x) cur+=cl[i][0];
    forn(i,st+x, st+x+y) cur+=cl[i][1];
    forn(i,st+x+y, st+x+y+z) cur+=cl[i][2];
    ll res = -INF;
    res = max(res, cur);
    forn(nst,0,x+y+z) {
        cur -= cl[(nst+x)%n][1];
        cur += cl[(nst+x)%n][0];
        cur -= cl[(nst+x+y)%n][2];
        cur += cl[(nst+x+y)%n][1];
        cur -= cl[(nst+x+y+z)%n][0];
        cur += cl[(nst+x+y+z)%n][2];
        res = max(res,cur);
    }
    return res;
}

int main()
{

    
    scanf("%d %d %d", &x, &y, &z);
    n = x+y+z;
//    vpi gs, sb, gb;
    vpi gm, sm, bm;
    
    
    ll ans = 0;
    ll cur = 0;
    vector<pair<int, pi>> al;
    forn(i,0,n) {
        int a,b,c;
        scanf("%d %d %d", &a, &b, &c);
        cur += c;
        al.pb(mp(a-b, mp(a-c,b-c)));
//        int d = min(a, min(b,c));
//        int dm = max(a, max(b,c));
//        if(dm==a) {
//            gs1.pb(mp(a-b, mp(a,b)));
//            gb2.pb(mp(a-c, mp(a,c)));
//        }
//        else if(dm==b) {
//            sb1.pb(mp(b-c,mp(b,c)));
//            gs2.pb(mp(a-b,mp(a,b)));
//        }
//        else if(dm == c) {
//            gb1.pb(mp(a-c,mp(a,c)));
//            sb2.pb(mp(b-c,mp(b,c)))
//        }
//        if(a==0) sb.pb(mp(b-c,mp(b,c)));
//        else if(b==0) gb.pb(mp(a-c,mp(a,c)));
//        else if(c==0) gs.pb(mp(a-b,mp(a,b)));
        
    }
    sort(all(al));
    cout<<cur+cnt(x, y, al);
//    cout<<max(test(gs1,sb1,gb1),test(gs2,sb2,gb2));
    
    
    
}



Measured memory_bytes: 6900