// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define int long long

typedef pair <int, int> pii;



const int N = 3e5 + 10;

int x, y, z, dpl[N], dpr[N];

multiset <pii> st;



struct ms {

	int a, b, c;

	

	ms() {

		a = b = c = 0;

	}

	

	ms(int x, int y, int z) {

		a = x;

		b = y;

		c = z;

	}

} ar[N];



int32_t main() {

	ios::sync_with_stdio(0);

	cin.tie(0);

	

	cin >> x >> y >> z;

	for (int i = 0; i < x + y + z; i++) {

		int a, b, c;

		cin >> a >> b >> c;

		ar[i] = ms(a, b, c);

	}

	sort(ar, ar + x + y + z, [&] (ms a, ms b) { return a.b + b.c > a.c + b.b; });

	

	int ansx = 0, ansy = 0;

	pii last;

	for (int i = 0; i < y; i++) {

		st.insert({ar[i].a - ar[i].b, ar[i].b});

		ansy += ar[i].b;

	}

	last = *st.rbegin();

	dpl[y - 1] = ansy;

	

	for (int i = y; i < x + y; i++) {

		int tmp = ar[i].a - ar[i].b, ty = ar[i].b;

		if (tmp >= last.first) {

			st.insert({tmp, ty});

			ansx += ar[i].a;

		}

		else {

			st.insert({tmp, ty});

			auto it = st.lower_bound(last);

			assert(it != st.begin());

			it--;

			ansy += ty;

			ansy -= last.second;

			ansx += last.second + last.first;

			last = *it;

		}

		dpl[i] = ansx + ansy;

	}

	

	

	int ansz = 0;

	ansx = 0;

	st.clear();

	for (int i = x + y + z - 1; i >= x + y; i--) {

		st.insert({ar[i].a - ar[i].c, ar[i].c});

		ansz += ar[i].c;

	}

	last = *st.rbegin();

	dpr[x + y] = ansz;

	

	for (int i = x + y - 1; i >= y; i--) {

		int tmp = ar[i].a - ar[i].c, tz = ar[i].c;

		if (tmp >= last.first) {

			st.insert({tmp, tz});

			ansx += ar[i].a;

		}

		else {

			st.insert({tmp, tz});

			auto it = st.lower_bound(last);

			assert(it != st.begin());

			it--;

			ansz += tz;

			ansz -= last.second;

			ansx += last.second + last.first;

			last = *it;

		}

		dpr[i] = ansx + ansz;

	}

	

	

	int ans = 0;

	for (int i = y - 1; i < x + y; i++)

		ans = max(ans, dpl[i] + dpr[i + 1]);

	cout << ans;

}

// Faster C++ solution for the same problem (measured speedup: 8.32025350726262x):
///****In the name of ALLAH, most Gracious, most Compassionate****//



#include <bits/stdc++.h>

using namespace std;



typedef long long ll;

typedef pair <ll, ll> pii;



#define ALL(a) a.begin(), a.end()

#define FastIO ios::sync_with_stdio(false); cin.tie(0);cout.tie(0)

#define IN freopen("input.txt","r+",stdin)

#define OUT freopen("output.txt","w+",stdout)



#define DBG(a) cerr<< "line "<<__LINE__ <<" : "<< #a <<" --> "<<(a)<<endl

#define NL cout<<endl



template < class T1,class T2>

ostream &operator <<(ostream &os,const pair < T1,T2 > &p)

{

    os<<"{"<<p.first<<","<<p.second<<"}";

    return os;

}



const ll N=1e6+5;





ll lft[N];

ll rht[N];



ll a[N];

ll b[N];

ll c[N];



bool a_b(ll l,ll r)

{

    return a[l]-b[l] >a[r]-b[r];

}



int32_t main()

{

    FastIO;

    ll x,y,z;

    cin>>x>>y>>z;

    ll n = x+y+z;

    vector < ll  > p (n,0);

    ll ans = 0;

    for(ll i=0; i<n; i++)

    {

        cin>>a[i]>>b[i]>>c[i];

        p[i] = i;

    }

    sort(ALL(p), a_b);



    {

        priority_queue<ll > pq;

        ll now = 0, q = 0;

        for(ll i=0; i<n; i++)

        {

            ll ii = p[i];

            now+=c[ii];

            ll d= a[ii]-c[ii];

            q+=d;

            pq.push(-d);

            if(pq.size() > x)

            {

//                assert(pq.size());

                q+=pq.top();

                pq.pop();

            }

            lft[i] =now + q;

        }

    }

    {

        priority_queue<ll > pq;

        ll now = 0, q = 0;

        for(ll i=n-1; i>=0; i--)

        {

            ll ii = p[i];

            now+=c[ii];

            ll d= b[ii]-c[ii];

            q+=d;

            pq.push(-d);

            if(pq.size() > y)

            {

                q+=pq.top();

                pq.pop();

            }

            rht[i] =now + q;

        }

    }

    for(ll i=0; i<n-1; i++)

    {

        if(i+1 >= x and n-i-1 >= y)

            ans = max(ans, lft[i] + rht[i+1]);

    }

    cout<<ans<<"\n";

}