// 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.323638269823523x):
#include<bits/stdc++.h>

//#include <ext/pb_ds/assoc_container.hpp>

//#include <ext/pb_ds/tree_policy.hpp>

//using namespace __gnu_pbds;

#define eps 1e-6

#define eq(x,y) (fabs((x)-(y)) < eps)

using namespace std;

typedef long long ll;

typedef long double ld;

typedef pair<int,int>pii;

const int mod = 998244353;

long double PI = acosl(-1);

const ll infl = 1e18+100;

const int inf = 2e9+100;

const int nmax = 1e6+10;

const int MAXLG = log2(nmax)+1;

//mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

//typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;



bool cmp(pii a, pii b){

    return a.first-a.second < b.first-b.second;

}



int main(){

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



    int x,y,z;

    cin>>x>>y>>z;

    int n = x+y+z;

    vector<pii>v(n);

    ll tmp = 0;

    for(pii &z : v){

        cin>>z.first>>z.second;

        int p;

        cin>>p;

        tmp+=p;

        z.first-=p, z.second-=p;

    }

    sort(v.begin(), v.end(), cmp);



    vector<ll>sambam(n), samdan(n);

    priority_queue<int>bam, dan;

    ll curbam=0, curdan=0;



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

        bam.push(-v[i].second), curbam+=v[i].second;

        if(bam.size()>y) curbam+=bam.top(), bam.pop();

        sambam[i] = curbam;

    }

    for(int i=n-1; i>=0; i--){

        dan.push(-v[i].first), curdan+=v[i].first;

        if(dan.size()>x) curdan+=dan.top(), dan.pop();

        samdan[i] = curdan;

    }



    ll ans = -infl;

    for(int i=y; x<=n-i; i++) ans = max(ans, sambam[i-1]+samdan[i]);

    cout<<ans+tmp<<endl;

}

/*



*/