//Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=500023;
bool vis[N];
vector <int> adj[N];
bool comp(tuple <ll,ll,ll> a,tuple<ll,ll,ll> b)
{
    ll diff1=get<0>(a)-get<1>(a);
    ll diff2=get<0>(b)-get<1>(b);
    return diff1<diff2;
}
void solve()
{
    ll x,y,z;
    cin>>x>>y>>z;
    ll n=x+y+z;
    vector <tuple<ll,ll,ll>> v;
    rep(i,x+y+z)
    {
        ll p,q,r;
        cin>>p>>q>>r;
        v.pb(mt(p,q,r));
    }
    sort(all(v),comp);
    ll left[n+1]={0};
    set <tuple<ll,ll,ll,ll>> s;
    for(int i=0;i<y;i++)
    {
        s.insert(mt(get<1>(v[i])-get<2>(v[i]),get<0>(v[i]),get<1>(v[i]),get<2>(v[i])));
        left[y-1]+=(get<1>(v[i]));
    }
    for(int i=y;i<n;i++)
    {
        left[i]=left[i-1];
        auto it=get<0>((*s.begin()));
        ll curr=(get<1>(v[i])-get<2>(v[i]));
        if(curr<=it)
        {
            left[i]+=(get<2>(v[i]));
        }
        else
        {
            auto first=(*s.begin());
            left[i]-=(get<2>(first));
            left[i]+=(get<3>(first));
            left[i]+=(get<1>(v[i]));
            s.erase(s.begin());
            s.insert(mt(get<1>(v[i])-get<2>(v[i]),get<0>(v[i]),get<1>(v[i]),get<2>(v[i])));
        }
    }
    s.clear();
    ll right[n+1]={0};
    for(int i=n-1;i>=n-x;i--)
    {
        s.insert(mt(get<0>(v[i])-get<2>(v[i]),get<0>(v[i]),get<1>(v[i]),get<2>(v[i])));
        right[n-x]+=(get<0>(v[i]));
    }
    for(int i=n-x-1;i>=0;i--)
    {
        right[i]=right[i+1];
        auto it=get<0>((*s.begin()));
        ll curr=(get<0>(v[i])-get<2>(v[i]));
        if(curr<=it)
        {
            right[i]+=(get<2>(v[i]));
        }
        else
        {
            auto first=(*s.begin());
            right[i]-=(get<1>(first));
            right[i]+=(get<3>(first));
            right[i]+=(get<0>(v[i]));
            s.erase(s.begin());
            s.insert(mt(get<0>(v[i])-get<2>(v[i]),get<0>(v[i]),get<1>(v[i]),get<2>(v[i])));
        }
    }
    ll ans=0;
    for(int i=y-1;i<n-x;i++)
        ans=max(ans,left[i]+right[i+1]);
    cout<<ans<<'\n';
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 23408