// Copyright 2017 wu_qing
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <vector>

const int N = 1e5 + 10;

struct people {
    int64_t a, b, c, ab, ac, ba, bc, ca, cb;
    explicit people(int64_t a = 0, int64_t b = 0, int64_t c = 0) :
        a(a), b(b), c(c) {
            ab = b - a;
            ba = a - b;
            ac = c - a;
            ca = a - c;
            bc = c - b;
            cb = b - c;
        }
};

std::vector<people> a, b, c;
int x, y, z, ta, tb, tc;
int64_t ans;

int main() {
    scanf("%d%d%d", &x, &y, &z);
    for (int i = 1; i <= x; i++) {
        scanf("%d%d%d", &ta, &tb, &tc);
        a.emplace_back(ta, tb, tc);
    }
    for (int i = 1; i <= y; i++) {
        scanf("%d%d%d", &ta, &tb, &tc);
        b.emplace_back(ta, tb, tc);
    }
    for (int i = 1; i <= z; i++) {
        scanf("%d%d%d", &ta, &tb, &tc);
        c.emplace_back(ta, tb, tc);
    }
    while (true) {
        static bool flag;
        flag = true;
        std::sort(a.begin(), a.end(), [](people a, people b) {
                return a.ab > b.ab;
        });
        std::sort(b.begin(), b.end(), [](people a, people b) {
                return a.ba > b.ba;
        });
        for (auto i = a.begin(), j = b.begin(); i != a.end() && j != b.end(); i++, j++) {
            if (i -> ab + j -> ba > 0) {
                std::swap(*i, *j);
                flag = false;
            } else {
                break;
            }
        }
        std::sort(b.begin(), b.end(), [](people a, people b) {
                return a.bc > b.bc;
        });
        std::sort(c.begin(), c.end(), [](people a, people b) {
                return a.cb > b.cb;
        });
        for (auto i = b.begin(), j = c.begin(); i != b.end() && j != c.end(); i++, j++) {
            if (i -> bc + j -> cb > 0) {
                std::swap(*i, *j);
                flag = false;
            } else {
                break;
            }
        }
        std::sort(c.begin(), c.end(), [](people a, people b) {
                return a.ca > b.ca;
        });
        std::sort(a.begin(), a.end(), [](people a, people b) {
                return a.ac > b.ac;
        });
        for (auto i = c.begin(), j = a.begin(); i != c.end() && j != a.end(); i++, j++) {
            if (i -> ca + j -> ac > 0) {
                std::swap(*i, *j);
                flag = false;
            } else {
                break;
            }
        }
        std::sort(a.begin(), a.end(), [](people a, people b) {
                return a.ac > b.ac;
        });
        std::sort(b.begin(), b.end(), [](people a, people b) {
                return a.ba > b.ba;
        });
        std::sort(c.begin(), c.end(), [](people a, people b) {
                return a.cb > b.cb;
        });
        for (auto i = a.begin(), j = b.begin(), k = c.begin(); i != a.end(), j != b.end(), k != c.end(); i++, j++, k++) {
            if (i -> ac + j -> ba + k -> cb > 0) {
                std::swap(*i, *k);
                std::swap(*i, *j);
                flag = false;
            } else {
                break;
            }
        }
        std::sort(a.begin(), a.end(), [](people a, people b) {
                return a.ab > b.ab;
        });
        std::sort(b.begin(), b.end(), [](people a, people b) {
                return a.bc > b.bc;
        });
        std::sort(c.begin(), c.end(), [](people a, people b) {
                return a.ca > b.ca;
        });
        for (auto i = a.begin(), j = b.begin(), k = c.begin(); i != a.end(), j != b.end(), k != c.end(); i++, j++, k++) {
            if (i -> ab + j -> bc + k -> ca > 0) {
                std::swap(*i, *j);
                std::swap(*i, *k);
                flag = false;
            } else {
                break;
            }
        }
        if (flag)
            break;
    }
    for (auto i : a)
        ans += i.a;
    for (auto i : b)
        ans += i.b;
    for (auto i : c)
        ans += i.c;
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 14572