#include <bits/stdc++.h>

using namespace std;

#define all(v) (v).begin(), (v).end()

const int MOD = 1e9 + 7;

typedef long long li;

struct item
{
    int a, b, c;
    
    int change_eff(int from, int to)
    {
        assert(from != to);
        if (from > to) return -change_eff(to, from);
        
        if (from == 0 && to == 1) return b - a;
        if (from == 0 && to == 2) return c - a;
        return c - b;
    }
};

int X, Y, Z;
vector<item> x;

li get_answer()
{
    li answer = 0;
    for (int i = 0; i < X + Y + Z; i++)
    {
        if (i < X)
            answer += x[i].a;
        else if (i < X + Y)
            answer += x[i].b;
        else
            answer += x[i].c;
    }
    return answer;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> X >> Y >> Z;
    
    x.resize(X + Y + Z);
    for (int i = 0; i < X + Y + Z; i++)
        cin >> x[i].a >> x[i].b >> x[i].c;
    
    /*for (int t = 0; t < 1; t++)
    {
        sort(all(x), [](const item& x, const item& y) { return x.b - x.a < y.b - y.a; });
        sort(x.begin() + X, x.end(), [](const item& x, const item& y) { return x.c - x.b < y.c - y.b; });
        
        for (auto it: x) cout << it.a << " " << it.b << " " << it.c << endl;
    }*/
    
    //for (int t = 0; t < 5; t++)
    
    bool swapped = true;
    int nSwaps = 0;
    
    while (swapped)
    {
        nSwaps++;
        swapped = false;
        
        for (int c1 = 0; c1 < 3; c1++)
            for (int c2 = c1 + 1; c2 < 3; c2++)
            {
                vector<int> i1, i2;
                
                for (int i = 0; i < X + Y + Z; i++)
                {
                    int c = 0;
                    if (i >= X) c = 1;
                    if (i >= X + Y) c = 2;
                    
                    if (c == c1) i1.push_back(i);
                    if (c == c2) i2.push_back(i);
                }
                
                sort(all(i1), [&](int i, int j) { return x[i].change_eff(c1, c2) > x[j].change_eff(c1, c2); });
                sort(all(i2), [&](int i, int j) { return x[i].change_eff(c2, c1) > x[j].change_eff(c2, c1); });
                
                for (int i = 0; i < (int)min(i1.size(), i2.size()); i++)
                {
                    li delta = x[i1[i]].change_eff(c1, c2) + (li)x[i2[i]].change_eff(c2, c1);
                    if (delta > 0)
                    {
                        //li old = get_answer();
                        swap(x[i1[i]], x[i2[i]]);
                        //li now = get_answer();
                        //cout << now - old << " " << delta << "\n";
                        swapped = true;
                    }
                }
            }
        
        {
            vector<int> i1, i2, i3;
            for (int i = 0; i < X + Y + Z; i++)
            {
                int c = 0;
                if (i >= X) c = 1;
                if (i >= X + Y) c = 2;
                
                if (c == 0) i1.push_back(i);
                if (c == 1) i2.push_back(i);
                if (c == 2) i3.push_back(i);
            }
            
            sort(all(i1), [&](int i, int j) { return x[i].change_eff(0, 1) > x[j].change_eff(0, 1); });
            sort(all(i2), [&](int i, int j) { return x[i].change_eff(1, 2) > x[j].change_eff(1, 2); });
            sort(all(i3), [&](int i, int j) { return x[i].change_eff(2, 0) > x[j].change_eff(2, 0); });
            
            for (int i = 0; i < (int)min({ i1.size(), i2.size(), i3.size() }); i++)
            {
                li delta = x[i1[i]].change_eff(0, 1) + (li)x[i2[i]].change_eff(1, 2) + (li)x[i3[i]].change_eff(2, 0);
                if (delta > 0)
                {
                    //li old = get_answer();
                    // 0 1 2 -> 2 0 1
                    // 0 2 1
                    swap(x[i2[i]], x[i3[i]]);
                    swap(x[i1[i]], x[i2[i]]);
                    //li now = get_answer();
                    //cout << delta << " " << now - old << endl;
                    swapped = true;
                }
            }
        }
        
        {
            vector<int> i1, i2, i3;
            for (int i = 0; i < X + Y + Z; i++)
            {
                int c = 0;
                if (i >= X) c = 1;
                if (i >= X + Y) c = 2;
                
                if (c == 0) i1.push_back(i);
                if (c == 1) i2.push_back(i);
                if (c == 2) i3.push_back(i);
            }
            
            sort(all(i1), [&](int i, int j) { return x[i].change_eff(0, 2) > x[j].change_eff(0, 2); });
            sort(all(i2), [&](int i, int j) { return x[i].change_eff(1, 0) > x[j].change_eff(1, 0); });
            sort(all(i3), [&](int i, int j) { return x[i].change_eff(2, 1) > x[j].change_eff(2, 1); });
            
            for (int i = 0; i < (int)min({ i1.size(), i2.size(), i3.size() }); i++)
            {
                li delta = x[i1[i]].change_eff(0, 2) + (li)x[i2[i]].change_eff(1, 0) + (li)x[i3[i]].change_eff(2, 1);
                if (delta > 0)
                {
                    //li old = get_answer();
                    // 0 1 2 -> 1 2 0
                    // 1 0 2
                    swap(x[i1[i]], x[i2[i]]);
                    swap(x[i2[i]], x[i3[i]]);
                    //li now = get_answer();
                    //cout << delta << " " << now - old << endl;
                    swapped = true;
                }
            }
        }
    }
    
    //printf("%d swaps\n", nSwaps);
    cout << get_answer() << endl;
    
    return 0;
}

Measured memory_bytes: 2384