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

using namespace std;

void __dump(int x){cerr << x;}

void __dump(long long x){cerr << x;}

void __dump(long double x){cerr << fixed << setprecision(3) << x;}

void __dump(char x){cerr << '\'' << x << '\'';}

void __dump(const string &x){cerr << '"' << x << '"';}

void __dump(const char *x){cerr << '"' << x << '"';}

void __dump(bool x){cerr << (x ? "true" : "false");}

void _dump(){cerr << "\n";}

template <typename T, typename U> void __dump(const pair<T, U> &x){cerr << '{'; __dump(x.first); cerr << ','; __dump(x.second); cerr << '}';}

template <typename T, typename U, typename V> void __dump(const tuple<T, U, V> &x){cerr << '{'; __dump(get<0>(x)); cerr << ',';  __dump(get<1>(x)); cerr << ',';  __dump(get<2>(x)); cerr << '}';}

template <typename T> void __dump(const T& x){int f=0; cerr << '{'; for(auto&i:x) cerr << (f++ ? "," : ""), __dump(i); cerr << "}";}

template <typename T, typename ... U> void _dump(T t, U ... u){__dump(t); if(sizeof...(u)) cerr << ", "; _dump(u...);}

#define dump(x ...) cerr  <<  "|| "  <<  # x  <<  "  =  ", _dump(x) 

//#define int long long

#define FAST ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

#define size(x) (int)x.size()

#define all(x) x.begin(),x.end()

#define ln '\n'

#define __ ' '

#define LL long long

#define LD long double

#define pii pair<int,int>

const int INF = 2e9;

const int NN = 1e5;

int x,y,z;

int n;

int a[NN+3], b[NN+3], c[NN+3];

int p[NN+3];

priority_queue<LL, vector<LL>, greater<LL>> prefPQ, suffPQ;

LL pref[NN+3], suff[NN+3];

LL ans, sumC;



int main(){ FAST

	cin >> x >> y >> z;

	n = x + y + z;

	for(int i=1; i<=n; ++i) cin >> a[i] >> b[i] >> c[i];



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

		a[i] -= c[i];

		b[i] -= c[i];

		sumC += c[i];

	}



	for(int i=1; i<=n; ++i) p[i] = i;

	sort(p+1, p+n+1, [&](int l, int r){ return a[l]-b[l] < a[r]-b[r]; });



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

		LL cur = b[p[i]];



		prefPQ.push(cur);

		pref[i] = pref[i-1] + cur;

	}

	for(int i=y+1; i<=n; ++i){

		LL cur = b[p[i]];



		pref[i] = pref[i-1];

		pref[i] += cur;

		prefPQ.push(cur);

		pref[i] -= prefPQ.top();

		prefPQ.pop();

	}



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

		LL cur = a[p[i]];



		suffPQ.push(cur);

		suff[i] = suff[i+1] + cur;

	}

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

		LL cur = a[p[i]];



		suff[i] = suff[i+1];

		suff[i] += cur;

		suffPQ.push(cur);

		suff[i] -= suffPQ.top();

		suffPQ.pop();

	}



	for(int ind=y; ind+x<=n; ++ind) ans = max(ans, sumC + pref[ind] + suff[ind+1]);



	cout << ans << ln;

}