#include <string.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
// #include <unordered_map>
// #include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair

#ifdef ONLINE_JUDGE
#define link renamelink
#define next renamenext
#define prev renameprev
#endif

using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef long double ld;

inline void EnableFileIO(const string &fileName, bool local = 0) {
  if (fileName.empty()) return;
  if (local) {
    freopen((fileName + ".in").c_str(), "r", stdin);
    freopen((fileName + ".out").c_str(), "w", stdout);
    return;
  }
#ifdef ONLINE_JUDGE
  freopen((fileName + ".in").c_str(), "r", stdin);
  freopen((fileName + ".out").c_str(), "w", stdout);
#endif
}

const int INF = (1 << 30) - 1;
const LL LINF = (1LL << 61) - 1;
const double EPS = 1e-10, PI = acos(-1);
const int N = 1e5 + 100;

int n, x, y, z;
LL ans = 0;

#define del(i)                  \
  ab.erase(mp(a[i] - b[i], i)); \
  ba.erase(mp(b[i] - a[i], i)); \
  ac.erase(mp(a[i] - c[i], i)); \
  ca.erase(mp(c[i] - a[i], i)); \
  bc.erase(mp(b[i] - c[i], i)); \
  cb.erase(mp(c[i] - b[i], i));
#define insa(i)                  \
  ab.insert(mp(a[i] - b[i], i)); \
  ac.insert(mp(a[i] - c[i], i));
#define insb(i)                  \
  ba.insert(mp(b[i] - a[i], i)); \
  bc.insert(mp(b[i] - c[i], i));
#define insc(i)                  \
  ca.insert(mp(c[i] - a[i], i)); \
  cb.insert(mp(c[i] - b[i], i));
inline bool proc1(int *a, int *b, int *c, set<pii> &ab, set<pii> &ba,
                  set<pii> &ac, set<pii> &ca, set<pii> &bc, set<pii> &cb) {
  // proc ab
  pii l = *ab.begin(), r = *ba.begin();
  if (l.first + r.first < 0) {
    ans -= l.first + r.first;
    int x = l.second, y = r.second;
    del(x);
    del(y);
    // x -> a to b, y -> b to a
    insb(x);
    insa(y);
    return 1;
  }
  return 0;
}
inline bool proc2(int *a, int *b, int *c, set<pii> &ab, set<pii> &ba,
                  set<pii> &ac, set<pii> &ca, set<pii> &bc, set<pii> &cb) {
  pii pa = *ab.begin(), pb = *bc.begin(), pc = *ca.begin();
  if (pa.first + pb.first + pc.first < 0) {
    ans -= pa.first + pb.first + pc.first;
    int x = pa.second, y = pb.second, z = pc.second;
    del(x);
    del(y);
    del(z);
    insb(x);
    insc(y);
    insa(z);
    return 1;
  }
  return 0;
}
bool proc(int *a, int *b, int *c, set<pii> &ab, set<pii> &ba, set<pii> &ac,
          set<pii> &ca, set<pii> &bc, set<pii> &cb) {
  return proc1(a, b, c, ab, ba, ac, ca, bc, cb) ||
         proc2(a, b, c, ab, ba, ac, ca, bc, cb);
}
int a[N], b[N], c[N];
set<pii> ab, ba, ac, ca, bc, cb;

int main() {
  // srand((int)time(0));
  // printf("Hello, world!\n");
  // EnableFileIO("");

  cin >> x >> y >> z;
  n = x + y + z;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i];
  }
  for (int i = 0; i < x; i++) {
    ans += a[i];
    insa(i);
  }
  for (int i = x; i < x + y; i++) {
    ans += b[i];
    insb(i);
  }
  for (int i = x + y; i < n; i++) {
    ans += c[i];
    insc(i);
  }
  while (true) {
    int f = 0;
    f |= proc(a, b, c, ab, ba, ac, ca, bc, cb);
    f |= proc(a, c, b, ac, ca, ab, ba, cb, bc);
    f |= proc(b, c, a, bc, cb, ba, ab, ca, ac);
    f |= proc(b, a, c, ba, ab, bc, cb, ac, ca);
    f |= proc(c, a, b, ca, ac, cb, bc, ab, ba);
    f |= proc(c, b, a, cb, bc, ca, ac, ba, ab);
    if (!f) break;
  }
  /*
  for (auto i : ab) cerr << i.second << ' ';
  cerr << endl;
  for (auto i : bc) cerr << i.second << ' ';
  cerr << endl;
  for (auto i : ca) cerr << i.second << ' ';
  cerr << endl;
   */
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 10752