#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define modsum(a, b) ((a) + (b) >= M ? (a) + (b) - M : (a) + (b))
#define modsubtract(a, b) ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b))
#define modmultiply(a, b) (((a) * (b)) % M)
#define insum(a, b)  a = modsum(a, (b))
#define insubtract(a, b) a = modsubtract(a, (b))
#define inmultiply(a, b) a = modmultiply(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < (int)(n); ++i)
#define cint const int &
#define SZ(a) ((int)(a.size()))
#ifdef MAX_HOME
#define watch(x) cout << (#x) << " = " << x << endl;
#else
#define watch(x) cerr << (#x) << " = " << x << endl;
#endif

const double PI = 2 * acos(0.0);

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template<class T>
ostream & operator << (ostream &out, vector<T> &a) {
    out << "{";
    for (auto x : a) out << x << " ";
    return out << "}";
}

template<class T>
ostream & operator << (ostream &out, pair<T, T> &a) {
    out << "{";
    cout << a.first << ", " << a.second;
    return out << "}";
}

void smain();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
#endif

    cout << setprecision(12) << fixed;

    smain();
}
/* END OF TEMPLATE ========================================================================================================================================== */;

const int N = 1e5 + 9;

int x, y, z;
int n;
vector<pll> arr;

bool cmp(pll f, pll s) {
    return f.second - f.first < s.second - s.first;
}

ll pref[N];
ll suf[N];

void smain() {

    cin >> x >> y >> z;
    n = x + y + z;
    arr.resize(n);
    ll sum = 0;
    fori (i, n) {
        int a, b, c;
        cin >> a >> b >> c;
        sum += a;
        b -= a;
        c -= a;
        arr[i] = {b, c};
    }
    sort(ALL(arr), cmp);

    multiset<ll> sack;
    ll gath = 0;
    for (int i = 0; i < n; ++i) {
        sack.insert(arr[i].first);
        gath += arr[i].first;
        if (sack.size() > y) {
            ll val = *sack.begin();
            gath -= val;
            sack.erase(sack.find(val));
        }
        pref[i] = gath;
        if (sack.size() != y) pref[i] = -1;
    }

    gath = 0;
    sack.clear();

    for (int i = n - 1; i >= 0; --i) {
        sack.insert(arr[i].second);
        gath += arr[i].second;
        if (sack.size() > z) {
            ll val = *sack.begin();
            gath -= val;
            sack.erase(sack.find(val));
        }
        suf[i] = gath;
        if (sack.size() != z) suf[i] = -1;
    }

    ll ans = -1;
    for (int i = 0; i < n - 1; ++i) {
        if (pref[i] != -1 && suf[i + 1] != -1) inmax(ans, sum + pref[i] + suf[i + 1]);
    }
    cout << ans;
}



Measured memory_bytes: 7808