#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
using namespace std;

const int MAX_N = 100005;
typedef long long LL;

class Person {
public:
  int A, B, C;
} p[MAX_N];

bool cmp(Person a, Person b) {
  return a.A - a.B < b.A - b.B;
}

int N, X, Y, Z;
LL res = 0;

priority_queue<int, vector<int>, greater<int> > q;
LL pre[MAX_N], suf[MAX_N];

int main() {
  scanf("%d%d%d", &X, &Y, &Z);
  N = X + Y + Z;
  for (int i = 1; i <= N; ++i)
    scanf("%d%d%d", &p[i].A, &p[i].B, &p[i].C);
  
  sort(p + 1, p + N + 1, cmp);

  for (int i = 1; i <= N; ++i)
    res += p[i].C, p[i].A -= p[i].C, p[i].B -= p[i].C;

  for (int i = 1; i <= N; ++i) {
    pre[i] = pre[i - 1] + p[i].B;
    q.push(p[i].B);
    if (q.size() > Y) pre[i] -= q.top(), q.pop();
  }

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

  for (int i = N; i; --i) {
    suf[i] = suf[i + 1] + p[i].A;
    q.push(p[i].A);
    if (q.size() > X) suf[i] -= q.top(), q.pop();
  }

  LL now = -0x3f3f3f3f3f3f3f3fLL;
  for (int i = Y; i <= N - X; ++i)
    now = max(now, pre[i] + suf[i + 1]);
  
  printf("%lld\n", res + now);
  return 0;
}
