#pragma comment(linker, "/STACK:512000000")
#define _CRT_SECURE_NO_WARNINGS
//#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

#define all(a) a.begin(), a.end()
typedef long long li;
typedef long double ld;
void solve(bool);
void precalc();
clock_t start;
int main() {
#ifdef AIM
  freopen("/home/alexandero/ClionProjects/ACM/input.txt", "r", stdin);
  //freopen("/home/alexandero/ClionProjects/ACM/output.txt", "w", stdout);
  //freopen("out.txt", "w", stdout);
#else
  //freopen("input.txt", "r", stdin);
  //freopen("output.txt", "w", stdout);
#endif
  start = clock();
  int t = 1;
  cout.sync_with_stdio(0);
  cin.tie(0);
  precalc();
  cout.precision(10);
  cout << fixed;
  //cin >> t;
  int testNum = 1;
  while (t--) {
    //cout << "Case #" << testNum++ << ": ";
    //cerr << testNum << endl;
    solve(true);
    //cerr << testNum - 1 << endl;
  }
  cout.flush();
#ifdef AIM1
  while (true) {
      solve(false);
  }
#endif

#ifdef AIM
  cerr << "\n\n time: " << (clock() - start) / 1.0 / CLOCKS_PER_SEC << "\n\n";
#endif

  return 0;
}

//BE CAREFUL: IS INT REALLY INT?

template<typename T>
T binpow(T q, T w, T mod) {
  if (!w)
    return 1 % mod;
  if (w & 1)
    return q * 1LL * binpow(q, w - 1, mod) % mod;
  return binpow(q * 1LL * q % mod, w / 2, mod);
}

template<typename T>
T gcd(T q, T w) {
  while (w) {
    q %= w;
    swap(q, w);
  }
  return q;
}
template<typename T>
T lcm(T q, T w) {
  return q / gcd(q, w) * w;
}

void precalc() {

}

template<typename T>
void relax_min(T& cur, T val) {
  cur = min(cur, val);
}

template<typename T>
void relax_max(T& cur, T val) {
  cur = max(cur, val);
}

#define int li
//const int mod = 1000000007;

struct Item {
  int gold, silver;
};

const int INF = (int)1e18;

void solve(bool read) {
  int x, y, z;
  cin >> x >> y >> z;
  int n = x + y + z;
  vector<Item> items;
  int initial = 0;
  for (int i = 0; i < n; ++i) {
    int a, b, c;
    cin >> a >> b >> c;
    initial += c;
    a -= c;
    b -= c;
    items.push_back({a, b});
  }
  sort(all(items), [&](const Item& q, const Item& w) {
    return q.gold - q.silver > w.gold - w.silver;
  });

  vector<int> best_gold_sum(n, -INF), best_silver_sum(n, -INF);

  multiset<int> best_gold;
  int gold_sum = 0;
  for (int i = 0; i < n; ++i) {
    int cur = items[i].gold;
    if (best_gold.size() < x) {
      best_gold.insert(cur);
      gold_sum += cur;
    } else {
      auto it = best_gold.begin();
      if (*it < cur) {
        gold_sum -= *it;
        best_gold.erase(it);
        best_gold.insert(cur);
        gold_sum += cur;
      }
    }
    if (best_gold.size() == x) {
      best_gold_sum[i] = gold_sum;
    }
  }

  best_gold.clear();
  gold_sum = 0;
  for (int i = n - 1; i >= 0; --i) {
    int cur = items[i].silver;
    if (best_gold.size() < y) {
      best_gold.insert(cur);
      gold_sum += cur;
    } else {
      auto it = best_gold.begin();
      if (*it < cur) {
        gold_sum -= *it;
        best_gold.erase(it);
        best_gold.insert(cur);
        gold_sum += cur;
      }
    }
    if (best_gold.size() == y) {
      best_silver_sum[i] = gold_sum;
    }
  }

  int ans = -INF;
  for (int i = 0; i + 1 < n; ++i) {
    int cur_ans = best_gold_sum[i] + best_silver_sum[i + 1];
    relax_max(ans, initial + cur_ans);
  }

  cout << ans << endl;

}

Measured memory_bytes: 7792