#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 1e5 + 5;
int need[3], n;
int x[3][maxn];

int read() {
  if (scanf("%d%d%d", &need[0], &need[1], &need[2]) < 3) {
    return false;
  }
  n = need[0] + need[1] + need[2];
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &x[0][i], &x[1][i], &x[2][i]);
  }
  return true;
}

pair<int, int> tosort[3][maxn];
int pos[3][maxn];

struct node {
  int cnt;
  long long sum[3];

  node() {
    cnt = 0;
    for (int i = 0; i < 3; i++) {
      sum[i] = 0;
    }
  }

  node(long long a, long long b, long long c) {
    cnt = 1;
    sum[0] = a;
    sum[1] = b;
    sum[2] = c;
  }

  node(const node &l, const node &r) {
    cnt = l.cnt + r.cnt;
    for (int i = 0; i < 3; i++) {
      sum[i] = l.sum[i] + r.sum[i];
    }
  }
};

node st[2][4 * maxn];

void buildst(int t, int v, int tl, int tr) {
  st[t][v] = node();
  if (tl == tr - 1) {
    return;
  }
  int tm = (tl + tr) / 2;
  buildst(t, 2 * v, tl, tm);
  buildst(t, 2 * v + 1, tm, tr);
}

void add(int t, int v, int tl, int tr, int pos) {
  if (tl == tr - 1) {
    assert(!st[t][v].cnt);
    int id = tosort[t + 1][pos].second;
    st[t][v] = node(x[0][id], x[1][id], x[2][id]);
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos < tm) {
    add(t, 2 * v, tl, tm, pos);
  } else {
    add(t, 2 * v + 1, tm, tr, pos);
  }
  st[t][v] = node(st[t][2 * v], st[t][2 * v + 1]);
}

void del(int t, int v, int tl, int tr, int pos) {
  if (tl == tr - 1) {
    assert(st[t][v].cnt);
    st[t][v] = node();
    return;
  }
  int tm = (tl + tr) / 2;
  if (pos < tm) {
    del(t, 2 * v, tl, tm, pos);
  } else {
    del(t, 2 * v + 1, tm, tr, pos);
  }
  st[t][v] = node(st[t][2 * v], st[t][2 * v + 1]);
}

int getPos(int t, int v, int tl, int tr, int k) {
  if (tl == tr - 1) {
    if (!k && st[t][v].cnt) {
      return tl;
    }
    return tr;
  }
  int tm = (tl + tr) / 2;
  if (st[t][2 * v].cnt <= k) {
    return getPos(t, 2 * v + 1, tm, tr, k - st[t][2 * v].cnt);
  }
  return getPos(t, 2 * v, tl, tm, k);
}

long long getSum(int t, int v, int tl, int tr, int l, int r, int s) {
  if (l == tl && r == tr) {
    return st[t][v].sum[s];
  }
  int tm = (tl + tr) / 2;
  long long res = 0;
  if (l < tm) {
    res += getSum(t, 2 * v, tl, tm, l, min(r, tm), s);
  }
  if (r > tm) {
    res += getSum(t, 2 * v + 1, tm, tr, max(l, tm), r, s);
  }
  return res;
}

long long get(int t, int l) {
  int pos = getPos(t, 1, 0, n, l);
  return (pos ? getSum(t, 1, 0, n, 0, pos, t) : 0) + (pos < n ? getSum(t, 1, 0, n, pos, n, 2) : 0);
}

void solve() {
  for (int i = 0; i < n; i++) {
    tosort[0][i] = make_pair(x[1][i] - x[0][i], i);
    tosort[1][i] = make_pair(x[2][i] - x[0][i], i);
    tosort[2][i] = make_pair(x[2][i] - x[1][i], i);
  }
  for (int it = 0; it < 3; it++) {
    sort(tosort[it], tosort[it] + n);
    for (int i = 0; i < n; i++) {
      pos[it][tosort[it][i].second] = i;
    }
  }
  buildst(0, 1, 0, n);
  buildst(1, 1, 0, n);
  for (int i = 0; i < n; i++) {
    add(1, 1, 0, n, i);
  }
  long long res = 0;
  for (int i = 0; i <= n; i++) {
    if (i >= need[0] && n - i >= need[1]) {
      res = max(res, get(0, need[0]) + get(1, need[1]));
    }
    if (i >= n) {
      break;
    }
    int id = tosort[0][i].second;
    del(1, 1, 0, n, pos[2][id]);
    add(0, 1, 0, n, pos[1][id]);
  }
  printf("%lld\n", res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 30080