#include "bits/stdc++.h"
using namespace std;
const int N = 3e5 + 5;
const int SN = 1 << 20;
int x , y , z;
int n;
int a[N] , b[N] , c[N];
int score[N];
long long ans;
int done[N];
pair < int , int > arr[N];
struct data{
	int sum;
	long long asum;
	long long bsum;
	long long csum;
	data(){
		sum = 0;
		asum = 0;
		bsum = 0;
		csum = 0;
	}
};
inline data combine(const data &lft , const data &rgt){
	data res;
	res.sum = lft.sum + rgt.sum;
	res.asum = lft.asum + rgt.asum;
	res.bsum = lft.bsum + rgt.bsum;
	res.csum = lft.csum + rgt.csum;
	return res;
}
data segtree1[SN];
data segtree2[SN];
int pos1[N];
int pos2[N];
int tmp1[N];
int tmp2[N];
void pre(){
	for(int i = 1 ; i <= n ; ++i){
		tmp1[i] = i;
	}
	sort(tmp1 + 1 , tmp1 + 1 + n , [](int i , int j){
		return b[i] - a[i] > b[j] - a[j];
	});
	for(int i = 1 ; i <= n ; ++i){
		pos1[tmp1[i]] = i;
	}
	for(int i = 1 ; i <= n ; ++i){
		tmp2[i] = i;
	}
	sort(tmp2 + 1 , tmp2 + 1 + n , [](int i , int j){
		return c[i] - a[i] > c[j] - a[j];
	});
	for(int i = 1 ; i <= n ; ++i){
		pos2[tmp2[i]] = i;
	}
}
int who;
void update1(int l , int r , int node , int idx , int val){
	segtree1[node].sum += val;
	segtree1[node].asum += val * a[who];
	segtree1[node].bsum += val * b[who];
	segtree1[node].csum += val * c[who];
	if(l < r){
		int mid = l + r >> 1;
		if(idx <= mid){
			update1(l , mid , node + node , idx , val);
		}
		else{
			update1(mid + 1 , r , node + node + 1 , idx , val);
		}
	}
}
void update2(int l , int r , int node , int idx , int val){
	segtree2[node].sum += val;
	segtree2[node].asum += val * a[who];
	segtree2[node].bsum += val * b[who];
	segtree2[node].csum += val * c[who];
	if(l < r){
		int mid = l + r >> 1;
		if(idx <= mid){
			update2(l , mid , node + node , idx , val);
		}
		else{
			update2(mid + 1 , r , node + node + 1 , idx , val);
		}
	}
}
void update1(int idx , int val){
	who = idx;
	update1(1 , n , 1 , pos1[idx] , val);
}
void update2(int idx , int val){
	who = idx;
	update2(1 , n , 1 , pos2[idx] , val);
}
int query1(int l , int r , int node , int idx){
	while(l < r){
		int mid = l + r >> 1;
		if(segtree1[node + node].sum >= idx){
			node = node + node;
			r = mid;
		}
		else{
			idx -= segtree1[node + node].sum;
			l = mid + 1;
			node = node + node + 1;
		}
	}
	return l;
}
int query2(int l , int r , int node , int idx){
	while(l < r){
		int mid = l + r >> 1;
		if(segtree2[node + node].sum >= idx){
			node = node + node;
			r = mid;
		}
		else{
			idx -= segtree2[node + node].sum;
			l = mid + 1;
			node = node + node + 1;
		}
	}
	return l;
}
data query1(int l , int r , int node , int ql , int qr){
	if(l > qr || r < ql){
		return data();
	}
	if(l >= ql && r <= qr){
		return segtree1[node];
	}
	int mid = l + r >> 1;
	return combine(query1(l , mid , node + node , ql , qr) , query1(mid + 1 , r , node + node + 1 , ql , qr));
}
data query2(int l , int r , int node , int ql , int qr){
	if(l > qr || r < ql){
		return data();
	}
	if(l >= ql && r <= qr){
		return segtree2[node];
	}
	int mid = l + r >> 1;
	return combine(query2(l , mid , node + node , ql , qr) , query2(mid + 1 , r , node + node + 1 , ql , qr));
}
long long get(){
	int idx1 = query1(1 , n , 1 , y);
	int idx2 = query2(1 , n , 1 , z);
	data lft = query1(1 , n , 1 , 1 , idx1);
	data rgt = query2(1 , n , 1 , 1 , idx2);
	long long res = 0;
	res += lft.bsum;
	res += segtree1[1].asum - lft.asum;
	res += rgt.csum;
	res += segtree2[1].asum - rgt.asum;
	return res;
}
int tmp3[N];
void solve(){
	ans = 0;
	for(int i = 1 ; i <= n ; ++i){
		tmp3[i] = i;
	}
	sort(tmp3 + 1 , tmp3 + 1 + n , [](int i , int j){
		return b[i] - c[i] > b[j] - c[j];
	});
	for(int i = 1 ; i <= y ; ++i){
		update1(tmp3[i] , 1);
	}
	for(int i = y + 1 ; i <= n ; ++i){
		update2(tmp3[i] , 1);
	}
	ans = max(ans , get());
	for(int i = y + 1 ; i <= x + y ; ++i){
		update1(tmp3[i] , 1);
		update2(tmp3[i] , -1);
		ans = max(ans , get());
	}
}
int main(){
	scanf("%d %d %d" , &x , &y , &z);
	n = x + y + z;
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d %d %d" , a + i , b + i , c + i);
	}
	pre();
	solve();
	printf("%lld\n" , ans);
}

Measured memory_bytes: 75136