#include <bits/stdc++.h>
using namespace std;
// define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define fi first
#define se second
// debug
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << "(" << p.first << "," << p.second << ")";return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if(it != v.begin())os << " ";os << *it;
      }return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &mp){
  for(auto x: mp)os << "(" << x.first << "," << x.second << ")" << endl;
  return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void PRINTF(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void PRINTF(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}
// typedef
typedef complex<double> Point;
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;



const int MAX = 100000;
struct st{int a, b, c;};
bool cmp1(st x, st y){return x.a-x.b > y.a-y.b;}
bool cmp2(st x, st y){return x.a-x.c > y.a-y.c;}
bool cmp3(st x, st y){return x.b-x.c > y.b-y.c;}
st s[MAX+1];
int s1[MAX+1], s2[MAX+1];

signed main(){
  int X, Y, Z;
  scanf("%lld%lld%lld", &X, &Y, &Z);
  int N = X+Y+Z;
  rrep(i,N){
    int x, y, z;
    scanf("%lld%lld%lld", &x, &y, &z);
    s[i] = st{x, y, z};
  }
  sort(s+1, s+N+1, cmp1);
  
  priority_queue<PP, vector<PP>, greater<PP>> q;
  rrep(i,N){
    s1[i] = s1[i-1];
    if(q.size() == X){
      PP p = q.top();
      if(p.fi < s[i].a-s[i].c){
        q.pop();
        s1[i] -= p.se.fi;s1[i] += s[i].a;s1[i] += p.se.se;
        q.push(PP(s[i].a-s[i].c, P(s[i].a, s[i].c)));
      }else s1[i] += s[i].c;
    }else{
      s1[i] += s[i].a;
      q.push(PP(s[i].a-s[i].c, P(s[i].a, s[i].c)));
    }
  }
  while(!q.empty())q.pop();
  drep(i,N,1){
    s2[i] = s2[i+1];
    if(q.size() == Y){
      PP p = q.top();
      if(p.fi < s[i].b-s[i].c){
        q.pop();
        s2[i] -= p.se.fi;s2[i] += s[i].b;s2[i] += p.se.se;
        q.push(PP(s[i].b-s[i].c, P(s[i].b, s[i].c)));
      }else s2[i] += s[i].c;
    }else{
      s2[i] += s[i].b;
      q.push(PP(s[i].b-s[i].c, P(s[i].b, s[i].c)));
    }
  }
  
  int ans = -INF;
  repi(i,X,N+1-Y){
    chmax(ans, s1[i]+s2[i+1]);
  }
  printf("%lld\n", ans);
	return 0;
}







Measured memory_bytes: 8436