// {{{ by shik
#include <bits/stdc++.h>
#include <unistd.h>
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-result"
#define SZ(x) ((int)(x).size())
#define ALL(x) begin(x),end(x)
#define RALL(x) rbegin(x),rend(x)
#define REP(i,n) for ( int i=0; i<int(n); i++ )
#define REP1(i,a,b) for ( int i=(a); i<=int(b); i++ )
#define MP make_pair
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef pair<int,int> PII;
typedef vector<int> VI;

template<class T> void _R( T &x ) { cin>>x; }
void _R( int &x ) { scanf("%d",&x); }
void _R( int64_t &x ) { scanf("%" PRId64,&x); }
void _R( double &x ) { scanf("%lf",&x); }
void _R( char &x ) { scanf(" %c",&x); }
void _R( char *x ) { scanf("%s",x); }
void R() {}
template<class T, class... U> void R( T& head, U&... tail ) { _R(head); R(tail...); }

template<class T> void _W( const T &x ) { cout<<x; }
void _W( const int &x ) { printf("%d",x); }
void _W( const int64_t &x ) { printf("%" PRId64,x); }
void _W( const double &x ) { printf("%.16f\n",x); }
void _W( const char &x ) { putchar(x); }
void _W( const char *x ) { printf("%s",x); }
template<class T> void _W( const vector<T> &x ) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W( const T& head, const U&... tail ) { _W(head); putchar(sizeof...(tail)?' ':'\n'); W(tail...); }

template<class T> inline bool chkmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chkmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;

#ifdef SHIK
template<class T> void _dump(const char *s, T &&head) { cerr << s << "=" << head << endl; }
template<class T, class... Args> void _dump(const char *s, T &&head, Args &&... tail) {
    for (int c = 0; *s != ',' || c != 0; cerr << *s++) {
        if (*s == '(' || *s == '[' || *s == '{') c++;
        if (*s == ')' || *s == ']' || *s == '}') c--;
    }
    cerr << "=" << head << ", ";
    _dump(s + 1, tail...);
}
#define dump(...) do { fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); _dump(#__VA_ARGS__, __VA_ARGS__); } while (0)

template<class Iter> ostream &_out(ostream &s, Iter b, Iter e) {
    s << "[";
    for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
    return s << "]";
}

template<class A, class B> ostream &operator<<(ostream &s, const pair<A, B> &p) { return s << "(" << p.first << "," << p.second << ")"; }
template<class T> ostream &operator<<(ostream &s, const vector<T> &c) { return _out(s, ALL(c)); }
template<class T, size_t N> ostream &operator<<(ostream &s, const array<T, N> &c) { return _out(s, ALL(c)); }
template<class T> ostream &operator<<(ostream &s, const set<T> &c) { return _out(s, ALL(c)); }
template<class A, class B> ostream &operator<<(ostream &s, const map<A, B> &c) { return _out(s, ALL(c)); }
#else
#define dump(...)
#endif
// }}}

struct MCMF {
    struct E { int to,c,w,r; };

    int n;
    vector<vector<E>> e;
    vector<vector<E>::iterator> cur;
    vector<int> dis;
    vector<char> vis;
    
    void init( int _n ) {
        n=_n;
        e.resize(n);
        for ( int i=0; i<n; i++ ) e[i].clear();
        cur.resize(n);
        dis.resize(n);
        vis.resize(n);
    }
    
    void add( int a, int b, int c, int w ) {
        e[a].push_back({b,c,w,(int)e[b].size()});
        e[b].push_back({a,0,-w,(int)e[a].size()-1});
    }
    
    int aug( int u, int f ) {
        if ( u==n-1 ) return f;
        vis[u]=1;
        int ret=0;
        for ( auto &it=cur[u]; it!=e[u].end(); it++ ) if ( it->c>0 ) {
            int v=it->to;
            if ( vis[v] || dis[u]!=dis[v]+it->w ) continue;
            int tf=aug(v,min(f-ret,it->c));
            ret+=tf;
            it->c-=tf;
            e[v][it->r].c+=tf;
            if ( ret==f ) break;
        }
        return ret;
    }
    
    bool relabel() {
        int d=INT_MAX;
        for ( int u=0; u<n; u++ ) if ( vis[u] )
            for ( auto &i:e[u] ) if ( i.c>0 && !vis[i.to] ) d=min(d,dis[i.to]+i.w-dis[u]);
        if ( d==INT_MAX ) return 0;
        for ( int i=0; i<n; i++ ) if ( vis[i] ) dis[i]+=d;
        return 1;
    }
    
    pair<long long,int> mcmf() {
        long long w=0;
        int f=0;
        fill(dis.begin(),dis.end(),0);
        do {
            for ( int i=0; i<n; i++ ) cur[i]=e[i].begin();
            while ( 1 ) {
                fill(vis.begin(),vis.end(),0);
                int tf=aug(0,INT_MAX);
                if ( tf==0 ) break;
                w+=1LL*tf*dis[0];
                f+=tf;
            }
        } while ( relabel() );
        return {w,f};
    }
} mcmf;

const int N=100010;
int n[3],sn,a[N][3];

LL slow() {
    const LL U=1e9;
    int sink=sn+4;
    mcmf.init(sink+1);
    REP(i,sn) mcmf.add(0,1+i,1,0);
    REP(i,sn) REP(j,3) mcmf.add(1+i,sn+1+j,1,U-a[i][j]);
    REP(i,3) mcmf.add(sn+1+i,sink,n[i],0);
    auto wf=mcmf.mcmf();
    LL ans=sn*U-wf.first;
    return ans;
}

int bel[N];
int main() {
    REP(i,3) R(n[i]);
    sn=n[0]+n[1]+n[2];
    REP(i,sn) REP(j,3) R(a[i][j]);
    // dump(slow());
    LL ans=0;
    set<pair<LL,int>> h[3][3];
    REP(i,sn) {
        int w=(i<n[0] ? 0 : (i<n[0]+n[1] ? 1 : 2));
        bel[i]=w;
        // dump(i,w,a[i][w]);
        ans+=a[i][w];
        REP(j,3) if ( j!=w ) h[w][j].insert({a[i][j]-a[i][w],i});
    }
    // dump(ans);
    while ( 1 ) {
        const VI cyc[]={{0,1},{0,2},{1,2},{0,1,2},{0,2,1}};
        bool found=0;
        // dump(h[0][1],h[0][2],h[1][0],h[1][2],h[2][0],h[2][1]);
        for ( auto &c:cyc ) {
            LL s=0;
            REP(i,SZ(c)) s+=h[c[i]][c[(i+1)%SZ(c)]].rbegin()->first;
            // dump(c,s);
            if ( s<=0 ) continue;
            ans+=s;
            found=1;
            vector<pair<LL,int>> v;
            REP(i,SZ(c)) v.PB(*h[c[i]][c[(i+1)%SZ(c)]].rbegin());
            // dump(v);
            REP(i,SZ(c)) {
                auto p=v[i];
                int id=p.second;
                int ci=c[i],cj=c[(i+1)%SZ(c)],ck=3-ci-cj;
                // assert(bel[id]==c[i]);
                bel[id]=cj;
                // assert(h[ci][cj].count(p));
                h[ci][cj].erase(p);
                // assert(h[ci][ck].count({a[id][ck]-a[id][ci],id}));
                h[ci][ck].erase({a[id][ck]-a[id][ci],id});
                REP(j,3) if ( j!=cj ) h[cj][j].insert({a[id][j]-a[id][cj],id});
            }
            break;
        }
        if ( !found ) break;
    }
    W(ans);
    return 0;
}


Measured memory_bytes: 14336