#include<iostream>
#include<algorithm>
#include<cstring>
#define INF -1e8
using namespace std;
const int MAXN=1e5;

int best[MAXN];
bool used[MAXN]={false};
int a[MAXN];
int b[MAXN];
int c[MAXN];

typedef struct A
{
    int r;
    int v;
} A;
A a1[MAXN];
A b1[MAXN];
A c1[MAXN];
bool camp(A a,A b)
{
    return a.v>b.v;
}
int main()
{
    long long int ans=0;
    int sum;
    int x,y,z;
    cin>>x>>y>>z;
    sum=x+y+z;
    memset(a1,-INF,sizeof(a1));
     memset(b1,-INF,sizeof(b1));
      memset(c1,-INF,sizeof(c1));
    for(int i=0;i<sum;i++)
        cin>>a[i]>>b[i]>>c[i];
for(int i=0;i<MAXN;i++)
{
    a1[i].v=a[i]-max(b[i],c[i]);
    a1[i].r=i;
}
sort(a1,a1+x,camp);
for(int i=0;i<x;i++)
{
    ans+=a[a1[i].r];
    used[a1[i].r]=1;
}
//cout<<ans<<endl;
for(int i=0;i<MAXN;i++)
{
    if(used[i])
        continue;
    b1[i].v=b[i]-max(a[i],c[i]);
    b1[i].r=i;
}
sort(b1,b1+y,camp);
for(int i=0;i<y;i++)
{

    ans+=b[b1[i].r];
    used[b1[i].r]=1;
}
//cout<<ans<<endl;
for(int i=0;i<MAXN;i++)
{
    if(used[i])
        continue;
    ans+=c[i];
}
cout<<ans;
return 0;
}
