#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef long long ll;
const int N = 100005;
const ll INF = 1000000000000000000;
int x,y,z;
int n;
ii A[N];
ll l[N], r[N];
bool cmp(ii a, ii b){
    return a.first-a.second > b.first-b.second;
}
int main(){
    scanf("%d%d%d",&x,&y,&z);
    n = x+y+z;
    ll ans = 0;
    for (int i = 0; i < n; i++){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        ans += c;
        A[i] = ii(a-c,b-c);
    }
    sort(A,A+n,cmp);
    priority_queue<int,vector<int> ,greater<int> > pq;
    ll sum = 0;
    for (int i = 0; i < n; i++){
        pq.push(A[i].first);
        sum += A[i].first;
        if (pq.size() > x){
            sum -= pq.top();
            pq.pop();
        }
        if (pq.size() == x) l[i] = sum;
        else l[i] = -INF;
    }
    while (pq.size()) pq.pop();
    sum = 0;
    for (int i = n-1; i >= 0; i--){
        pq.push(A[i].second);
        sum += A[i].second;
        if (pq.size() > y){
            sum -= pq.top();
            pq.pop();
        }
        if (pq.size() == y) r[i] = sum;
        else r[i] = -INF;
    }
    ll mx = -INF;
    for (int i = 0; i < n-1; i++){
        //printf("%lld %lld\n",l[i],r[i+1]);
        mx = max(mx,l[i]+r[i+1]);
    }
    printf("%lld",ans+mx);

}
