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

#define int long long

using namespace std;

const int maxN = 1e5 + 13;

int x, y, z, a[maxN], b[maxN], c[maxN], arr[maxN], pre[maxN], nxt[maxN], suf[maxN], mp[maxN], ans, tmp[maxN], prf[maxN], mx;

bool cmp (int i, int j) {

    if (a[i] - b[i] != a[j] - b[j])

	return a[i] - b[i] > a[j] - b[j];

    return i < j;

}



bool cmp2 (int i, int j) {

    if (b[i] != b[j])

	return b[i] > b[j];

    return i < j;

}

bool cmp3 (int i, int j) {

    if (a[i] != a[j])

	return a[i] > a[j];

    return i < j;

}



int32_t main () {

    cin >> x >> y >> z;

    int sum = x + y + z;

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

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

	a[i] -= c[i];

	b[i] -= c[i];

	ans += c[i];

    }

    iota(arr, arr + sum, 0);

    sort(arr, arr + sum, cmp);



    iota(tmp, tmp + sum, 0);

    sort(tmp, tmp + sum, cmp2);

    int r = y - 1;

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

	suf[0] += b[tmp[i]];

    }

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

	pre[i] = i - 1;

	nxt[i] = i + 1;

	mp[tmp[i]] = i;

    }

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

	suf[i] = suf[i - 1];

	if (mp[arr[i - 1]] <= r) {

	    r = nxt[r];

	    suf[i] -= b[arr[i - 1]];

	    suf[i] += b[tmp[r]];

	}

	else {

	    int pos = mp[arr[i - 1]];

	    pre[nxt[pos]] = pre[pos];

	    nxt[pre[pos]] = nxt[pos];

	}

	//cout << i << " " << suf[i] << endl;

    }



    iota(tmp, tmp + sum, 0);

    sort(tmp, tmp + sum, cmp3);

    r = x - 1;

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

	prf[sum - 1] += a[tmp[i]];

    }

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

	pre[i] = i - 1;

	nxt[i] = i + 1;

	mp[tmp[i]] = i;

    }

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

	prf[i] = prf[i + 1];

	if (mp[arr[i + 1]] <= r) {

	    r = nxt[r];

	    prf[i] -= a[arr[i + 1]];

	    prf[i] += a[tmp[r]];

	}

	else {

	    int pos = mp[arr[i + 1]];

	    pre[nxt[pos]] = pre[pos];

	    nxt[pre[pos]] = nxt[pos];

	}

	//cout << i << " " << prf[i] << endl;

    }

    for (int i = x - 1; i < sum - y; i++)

	mx = max(mx, prf[i] + suf[i + 1] + ans);

    cout << mx << endl;

}