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

#define int long long

const int inf = 1e18;

using namespace std;



template<typename tp> inline void read(tp &x) {

	x=0;char c=getchar();

	for(;c<'0'||c>'9';c=getchar());

	for(;c>='0'&&c<='9';x=(x<<3)+(x<<1)+c-'0',c=getchar());

}

const int N = 2e5 + 10 ; 

int x,y,z,n;

struct P {

	int a,b,c;

}p[N];

inline bool cmp(P a, P b) {

	return a.a-a.b<b.a-b.b;

}

int suma,sumb,sum,t1[N],t2[N],ans=0;

priority_queue<int,vector<int> , greater<int> > q;



main() {

	memset(t1,168,sizeof(t1));

	memset(t2,168,sizeof(t2));

	cin>>x>>y>>z;

	n=x+y+z;

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

		read(p[i].a);read(p[i].b);read(p[i].c);

		p[i].a-=p[i].c;

		p[i].b-=p[i].c;

		sum+=p[i].c;

	}

	sort(p+1,p+n+1,cmp);

	int ans=-inf;

	for(int k=1;k<=y;k++) q.push(p[k].b),sumb+=p[k].b,t1[k]=max(t1[k],sumb);

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

		int u=q.top();q.pop();

		sumb-=u;

		sumb+=max(u,p[k].b);

		t1[k]=max(t1[k],sumb);

		q.push(max(u,p[k].b));

	}

	while(!q.empty()) q.pop();

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

		q.push(p[k].a),suma+=p[k].a,t2[k]=max(t2[k],suma);

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

		int u=q.top();q.pop();

		suma-=u;

		suma+=max(u,p[k].a);

		t2[k]=max(t2[k],suma);

		q.push(max(u,p[k].a));

	}

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

//		printf("%d %d %d\n",p[i].a,p[i].b,p[i].c);

//	}

//	puts("____________");

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

//		printf("%d ",t1[i]);

//	}puts("____________");

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

//		printf("%d ",t2[i]);

//	}puts("____________");

	for(int k=y;k<=n-x;k++)

		ans=max(ans,t1[k]+t2[k+1]);

	cout<<ans+sum<<"\n";

}

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

using namespace std;

typedef long long ll;

inline char gc() {

	static char now[1<<16], *S, *T;

	if(S == T) {T = (S = now) + fread(now, 1, 1<<16, stdin); if(S == T) return EOF;}

	return *S++;

}

inline int read() {

	int x = 0, f = 1; char c = gc();

	while(c < '0' || c > '9') {(c ^ '-') ? 0 : (f = 0); c = gc();}

	while(c >= '0' && c <= '9') {x = (x << 3) + (x << 1) + (c ^ 48); c = gc();}

	return f ? x : ((~x) + 1);

}

#define N 100010

struct item {

	int a, b, c;

} p[N];

inline bool operator < (const item &A, const item &B) {

	return A.a - A.b > B.a - B.b;

}

int X, Y, Z, n;

priority_queue<int, vector<int>, greater<int> > q;

ll sum[2][N];

int main() {

	X = read(); Y = read(); Z = read();

	n = X + Y + Z;

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

		p[i].a = read(); p[i].b = read(); p[i].c = read();

	}

	sort(p + 1, p + n + 1);

	ll tot;

	tot = 0;

	while (!q.empty()) q.pop();

	for (int i = 1; i <= X - 1; ++ i) {

		q.push(p[i].a - p[i].c);

		tot += p[i].a - p[i].c;

	}

	for (int i = X; i <= n - Y; ++ i) {

		q.push(p[i].a - p[i].c);

		tot += p[i].a - p[i].c;

		while ((int)q.size() > X) {

			tot -= q.top();

			q.pop();

		}

		sum[0][i] = tot;

	}

	tot = 0;

	while (!q.empty()) q.pop();

	for (int i = n; i >= n - Y + 2; -- i) {

		q.push(p[i].b - p[i].c);

		tot += p[i].b - p[i].c;

	}

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

		q.push(p[i].b - p[i].c);

		tot += p[i].b - p[i].c;

		while ((int)q.size() > Y) {

			tot -= q.top();

			q.pop();

		}

		sum[1][i] = tot;

	}

	tot = 0;

	ll ans = 0;

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

	for (int i = X; i <= n - Y; ++ i) {

		ans = max(ans, tot + sum[0][i] + sum[1][i + 1]);

	}

	printf("%lld\n", ans);

	return 0;

}