#include <bits/stdc++.h>
using namespace std;

typedef long long int LLI;
typedef pair<LLI, int> Pair;

int n;
int X;
int Y;
int Z;
LLI XYZ[3][114514];
LLI coins[114514][4];
set<Pair> xyzs[3][3];

int GetType(int i) {
  if (i < X) return 0;
  else if (i < X+Y) return 1;
  return 2;
}

bool cmp(int a, int b) {
  int at = GetType(a);
  int bt = GetType(b);
  LLI cur = coins[a][at]+coins[b][bt];
  LLI wil = coins[b][at]+coins[a][bt];
  printf("%d,%d: %lld %lld\n", a, b, cur, wil);
  if (cur < wil) {
    swap(coins[a], coins[b]);
  }

  return cur > wil;
}

int main() {
  scanf("%d%d%d", &X, &Y, &Z);
  n = X+Y+Z;
  for (int i=0; i<n; i++) {
    for (int j=0; j<3; j++) {
      scanf("%lld", &coins[i][j]);
    }
    for (int j=0; j<3; j++) {
      XYZ[j][i] = coins[i][j] - coins[i][(j+1)%3];
      xyzs[j][GetType(i)].insert(Pair(XYZ[j][i], i));
    }
  }

  while (1) {
    //cout << "=============\n";
    /*for (int i=0; i<n; i++) {
      for (int j=0; j<3; j++) //cout << coins[i][j] << " ";
      //cout << "\n";
    }*/
    //cout << "=============\n";

    bool found = false;
    for (int i=0; i<3; i++) {
      if (xyzs[i][i].begin()->first < xyzs[i][(i+1)%3].rbegin()->first) {
        int a = xyzs[i][i].begin()->second;
        int b = xyzs[i][(i+1)%3].rbegin()->second;
        for (int k=0; k<3; k++) {
          xyzs[k][GetType(a)].erase(Pair(XYZ[k][a], a));
          xyzs[k][GetType(b)].erase(Pair(XYZ[k][b], b));
        }
        swap(coins[a], coins[b]);
        //cout << "swap: " << a << " " << b << "\n";
        for (int k=0; k<3; k++) {
          XYZ[k][a] = coins[a][k] - coins[a][(k+1)%3];
          xyzs[k][GetType(a)].insert(Pair(XYZ[k][a], a));
          XYZ[k][b] = coins[b][k] - coins[b][(k+1)%3];
          xyzs[k][GetType(b)].insert(Pair(XYZ[k][b], b));
        }
        found = true;
      }
    }

    LLI g = xyzs[0][0].begin()->first + xyzs[1][1].begin()->first;
    if (xyzs[2][2].begin()->first < -g) {
      int a = xyzs[0][0].begin()->second;
      int b = xyzs[1][1].begin()->second;
      int c = xyzs[2][2].begin()->second;
      for (int k=0; k<3; k++) {
        xyzs[k][GetType(a)].erase(Pair(XYZ[k][a], a));
        xyzs[k][GetType(b)].erase(Pair(XYZ[k][b], b));
        xyzs[k][GetType(c)].erase(Pair(XYZ[k][c], c));
      }
      //cout << "swap: " << a << " " << b << " " << c << "\n";
      swap(coins[a], coins[b]);
      swap(coins[a], coins[c]);
      for (int k=0; k<3; k++) {
        XYZ[k][a] = coins[a][k] - coins[a][(k+1)%3];
        xyzs[k][GetType(a)].insert(Pair(XYZ[k][a], a));
        XYZ[k][b] = coins[b][k] - coins[b][(k+1)%3];
        xyzs[k][GetType(b)].insert(Pair(XYZ[k][b], b));
        XYZ[k][c] = coins[c][k] - coins[c][(k+1)%3];
        xyzs[k][GetType(c)].insert(Pair(XYZ[k][c], c));
      }
      found = true;
    }

    g = xyzs[2][0].rbegin()->first + xyzs[0][1].rbegin()->first;
    if (xyzs[1][2].rbegin()->first > -g) {
      int a = xyzs[2][0].rbegin()->second;
      int b = xyzs[0][1].rbegin()->second;
      int c = xyzs[1][2].rbegin()->second;
      for (int k=0; k<3; k++) {
        xyzs[k][GetType(a)].erase(Pair(XYZ[k][a], a));
        xyzs[k][GetType(b)].erase(Pair(XYZ[k][b], b));
        xyzs[k][GetType(c)].erase(Pair(XYZ[k][c], c));
      }
      //cout << "swap: " << a << " " << b << " " << c << "\n";
      swap(coins[a], coins[b]);
      swap(coins[b], coins[c]);
      for (int k=0; k<3; k++) {
        XYZ[k][a] = coins[a][k] - coins[a][(k+1)%3];
        xyzs[k][GetType(a)].insert(Pair(XYZ[k][a], a));
        XYZ[k][b] = coins[b][k] - coins[b][(k+1)%3];
        xyzs[k][GetType(b)].insert(Pair(XYZ[k][b], b));
        XYZ[k][c] = coins[c][k] - coins[c][(k+1)%3];
        xyzs[k][GetType(c)].insert(Pair(XYZ[k][c], c));
      }
      found = true;
    }

    if (!found) break;
  }


  LLI ans = 0;
  for (int i=0; i<n; i++) {
    int idx = i;
    ans += coins[idx][GetType(idx)];
  }
  printf("%lld\n", ans);
}


Measured memory_bytes: 27136