#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<ll,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;

// coordinate compression
struct X {
  typedef P T;
  vector<T> d;
  void add(T x) { d.pb(x);}
  void init() {
    sort(rng(d));
    d.erase(unique(rng(d)), d.end());
  }
  int size() const { return sz(d);}
  T operator[](int i) const { return d[i];}
  int operator()(T x) const { return upper_bound(rng(d),x)-d.begin()-1;}
};
//

// get kth
struct bit {
  X xs;
  int x2; vi d; vl e;
  bit() {}
  void init() {
    xs.init();
    int mx = sz(xs)+5;
    x2 = 1; while(x2 < mx) x2 <<= 1;
    d = vi(x2+1); e = vl(x2+1);
  }
  void add(P ix, int x=1) {
    int i = x2-2-xs(ix);
    ll y = ix.fi*x;
    for (++i;i<=x2;i+=i&-i) d[i] += x, e[i] += y;
  }
  ll get(int k){
    assert(k <= d[x2]);
    int i = x2>>1, p = 0;
    ll res = 0;
    while (i) {
      if (d[p+i] <= k) {
        p += i;
        k -= d[p];
        res += e[p];
      }
      i >>= 1;
    }
    return res;
  }
};
//



int main() {
  int x,y,z;
  scanf("%d%d%d",&x,&y,&z);
  int n = x+y+z;
  vl a(n),b(n),c(n);
  rep(i,n) scanf("%lld%lld%lld",&a[i],&b[i],&c[i]);
  ll sum = 0;
  rep(i,n) sum += a[i];
  rep(i,n) b[i] = b[i]-a[i];
  rep(i,n) c[i] = c[i]-a[i];
  vp s(n);
  rep(i,n) s[i] = P(b[i],i);
  sort(rng(s)); reverse(rng(s));
  vi used(n);
  ll now = 0;
  rep(i,y) {
    int j = s[i].se;
    now += b[j];
    used[j] = 1;
  }

  bit d, e;
  rep(i,n) d.xs.add(P(c[i],i));
  rep(i,n) e.xs.add(P(c[i]-b[i],i));
  d.init();
  e.init();

  rep(i,n) {
    if (used[i]) e.add(P(c[i]-b[i],i));
    else d.add(P(c[i],i));
  }
  ll ans = now+d.get(z);

  for (int i = y; i < y+z; ++i) {
    int j = s[i].se;
    now += b[j];
    d.add(P(c[j],j),-1);
    e.add(P(c[j]-b[j],j));
    maxs(ans,now+d.get(y+z-i-1)+e.get(i-y+1));
  }

  cout<<ans+sum<<endl;
  return 0;
}






















Measured memory_bytes: 10736