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



using namespace std;



const int N = 123456;



int x, y, z, n;



struct info_t {

  int a, b, c;

} info[N];



int main() {

  ios::sync_with_stdio(false);

  cin.tie(0);

  cout.tie(0);

  cin >> x >> y >> z;

  n = x + y + z;

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

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

  }

  sort(info + 1, info + 1 + n, [&] (const info_t& x, const info_t& y) {

    return x.b - x.a < y.b - y.a;

  });

  multiset<int> heap1, heap2, heap3;

  long long answer = 0;

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

    answer += info[i].c;

  }

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

    heap1.insert(info[i].a - info[i].c);

  }

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

    heap2.insert(info[i].b - info[i].c);

  }

  while (heap2.size() > y) {

    heap3.insert(*heap2.begin());

    heap2.erase(heap2.begin());

  }

  for (auto x : heap1) {

    answer += x;

  }

  for (auto x : heap2) {

    answer += x;

  }

  long long t = answer;

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

    int foo = info[i].b - info[i].c, bar = info[i].a - info[i].c;

    if (heap2.find(foo) != heap2.end()) {

      int add = *(--heap3.end());

      heap3.erase(heap3.find(add));

      heap2.erase(heap2.find(foo));

      heap2.insert(add);

      t -= foo;

      t += add;

    } else {

      heap3.erase(heap3.find(foo));

    }

    if (bar >= *heap1.begin()) {

      t -= *heap1.begin();

      t += bar;

      heap1.erase(heap1.begin());

      heap1.insert(bar);

    }

    answer = max(answer, t);

  }

  cout << answer << '\n';

  return 0;

}