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

using namespace std;



typedef long long ll;

const ll N = 1e5 + 100, inF = 1e17;

ll A, B, C, n, a[N], b[N], c[N], dex[N], up[N], down[N];



int main() {

	ios::sync_with_stdio(false), cin.tie(0);

	cin >> A >> B >> C;

	n = A + B + C;

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

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

	iota(dex, dex + n, 0);

	sort(dex, dex + n, [](int x, int y) {

		return c[x] - b[x] < c[y] - b[y];

	});

	// a - b

	fill(up, up + N, -inF);

	multiset<ll> st;

	ll now = 0;

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

		int ind = dex[i];

		st.insert(a[ind] - b[ind]);

		now += b[ind];

	}

	if(B)

		up[B - 1] = now;

	for (int i = B; i < n; i++) {

		int ind = dex[i];

		if(B == 0) {

			now += a[ind];

			up[i] = now;

			continue;

		}

		if(a[ind] - b[ind] > (*st.rbegin()))

			now += a[ind];

		else {

			ll val = *st.rbegin();

			st.erase(st.find(val));

			now += val;

			now += b[ind];

			st.insert(a[ind] - b[ind]);

		}

		up[i] = now;

	}

	// a - c

	fill(down, down + N, -inF);

	st.clear();

	now = 0;

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

		int ind = dex[n - i -1];

		st.insert(a[ind] - c[ind]);

		now += c[ind];

	}

	down[n - C] = now;

	for (int i = C; i < n; i++) {

		int ind = dex[n - i - 1];

		if(C == 0) {

			now += a[ind];

			down[i] = now;

			continue;

		}

		if(a[ind] - c[ind] > (*st.rbegin()))

			now += a[ind];

		else {

			ll val = *st.rbegin();

			st.erase(st.find(val));

			now += val;

			now += c[ind];

			st.insert(a[ind] - c[ind]);

		}

		down[n - i - 1] = now;

	}

	ll ans = 0;

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

		ans = max(ans, up[i] + down[i + 1]);

	cout << ans;

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.564704800311615x):
#include <bits/stdc++.h>

typedef long long int ll;

typedef long double ld;

#define pb push_back

#define pii pair < int, int >

#define F first

#define S second

#define int  long long int

#define sync ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;

const int N=2e5+100,M=63;

ll x[N];

ll y[N];

ll z[N];

pii a[N];

pii ans1[N];

pii ans2[N];

int32_t main(){

    sync;

    ll x111,y111,z111;

    cin >> x111 >> y111 >> z111;

    ll n=x111+y111+z111;

    ll g=0;

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

        cin >> x[i] >> y[i] >> z[i];

        g+=z[i];

        a[i]={-x[i]+y[i],i};

    }

    sort(a,a+n);

    ll cnt=0;

    set <pii> s;

    ll w=0;



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

        ll id=a[i].S;

        s.insert({{x[id]-z[id]},id});

        w+=x[id];

        cnt+=z[id];

        ans1[i]={-1e9,1e9};

        if (i==x111-1){

            ans1[i]={w,cnt};

         //   cout << i << " " << w << " " << cnt << endl;

        }

    }

    for (int i=x111;i<n;i++){

        ll id=a[i].S;

        ll p=s.begin()->F;

        if (p<x[id]-z[id]){

            p=s.begin()->S;

            w-=x[p];

            cnt-=z[p];

            s.erase(s.begin());

            s.insert({{x[id]-z[id]},id});

            w+=x[id];

            cnt+=z[id];

        }

        ans1[i]={w,cnt};

       // cout << i << " " << w << " " << cnt << endl;

    }

    s.clear();

    reverse(a,a+n);

    w=0;

    cnt=0;



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

        ll id=a[i].S;

        s.insert({{y[id]-z[id]},id});

        w+=y[id];

        cnt+=z[id];

        ans2[i]={-1e9,1e9};

        if (i==y111-1){

            ans2[i]={w,cnt};

          //  cout << i << " " << w << " " << cnt << endl;

        }

    }

    for (int i=y111;i<n;i++){

        ll id=a[i].S;

        ll p=s.begin()->F;

        ll o=p;

        if (p<y[id]-z[id]){

            p=s.begin()->S;

            w-=y[p];

            cnt-=z[p];

            s.erase(s.begin());

            s.insert({{y[id]-z[id]},id});

            w+=y[id];

            cnt+=z[id];

        }

        ans2[i]={w,cnt};

      //  cout << i << " " << w << " " << cnt << " " << o << endl;

    }

    reverse(ans2,ans2+n);

    ll ma=0;

    for (int i=x111-1;i<n-y111;i++){

        ma=max(ma,ans1[i].F+ans2[i+1].F+g-ans1[i].S-ans2[i+1].S);

       // cout << i << " " << ans1[i].F << " " << ans2[i].F << " " << g << " " << ans1[i].F+ans2[i+1].F+g-ans1[i].S+ans2[i+1].S  << endl;

    }

    cout << ma << endl;



}