#include <bits/stdc++.h>
using namespace std;
 
struct nibab
{
    long long x,y,z;
} a[100005];
 
long long x,y,z,p[100005],q[100005],t,u[100005],v[100005],ans;
 
multiset <long long> s;
 
bool comp(nibab a, nibab b)
{
    return (a.x-a.y)>(b.x-b.y);
}
 
int main()
{
    cin >> x >> y >> z;
    for(int i=1;i<=x+y+z;i++)
        cin >> a[i].x >> a[i].y >> a[i].z;
    sort(a+1,a+x+y+z+1,comp);
    for(int i=1;i<=x+y+z;i++)
	{
        p[i]=a[i].x-a[i].z;
        q[i]=a[i].y-a[i].z;
    }
    for(int i=1;i<=x;i++)
	{
        s.insert(p[i]);
        p[i]+=p[i-1];
        u[i]=u[i-1]+a[i].z;
    }
    for(int i=x+1;i<=x+y+z;i++)
	{
        t=*(s.begin());
        if(p[i]<=t) p[i]=p[i-1];
        else s.erase(s.begin()),s.insert(p[i]),p[i]+=p[i-1]-t;
        u[i]=u[i-1]+a[i].z;
    }
    s.clear();
    for(int i=1;i<=y;i++)
	{
        s.insert(q[x+y+z-i+1]);
        q[x+y+z-i+1]+=q[x+y+z-i+2];
        v[x+y+z-i+1]=v[x+y+z-i+2]+a[x+y+z-i+1].z;
    }
    for(int i=y+1;i<=x+y+z;i++)
	{
        t=*(s.begin());
        if(q[x+y+z-i+1]<=t) q[x+y+z-i+1]=q[x+y+z-i+2];
        else s.erase(s.begin()),s.insert(q[x+y+z-i+1]),q[x+y+z-i+1]+=q[x+y+z-i+2]-t;
        v[x+y+z-i+1]=v[x+y+z-i+2]+a[x+y+z-i+1].z;
    }
    for(int i=x;i<=x+z;i++)
        ans=max(ans,u[i]+p[i]+v[i+1]+q[i+1]);
    cout << ans;
}