import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;


void main() {
    auto s = readln.split.map!(to!int);
    auto X = s[0];
    auto Y = s[1];
    auto Z = s[2];
    auto N = X + Y + Z;
    auto A = N.iota.map!(_ => readln.split.map!(to!long).array).array;

    int[3][3] key = [[-1, 0, 1],
                     [2, -1, 3],
                     [4, 5, -1]];

    auto pq = 6.iota.map!(_ => BinaryHeap!(Array!(Tuple!(int, long)), "a[1] < b[1]")()).array;

    auto pos = new int[](N);
    auto cnt = new int[](3);

    foreach (i; 0..N) {
        int mi = -1;
        long mv = -1;
        foreach (j; 0..3) if (A[i][j] > mv) mi = j, mv = A[i][j];
        pos[i] = mi;
        cnt[mi] += 1;
        foreach (j; 0..3) {
            int x = key[mi][j];
            if (x < 0) continue;
            pq[x].insert(tuple(i, A[i][j] - A[i][mi]));
        }
    }


    while (cnt[0] != X || cnt[1] != Y || cnt[2] != Z) {
        int mi = -1;
        long mv = - (1L << 60);
        int k1 = 1, k2 = -1;

        if (cnt[0] > X && cnt[1] < Y) {
            while (!pq[0].empty) {
                auto t = pq[0].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 0) {
                    pq[0].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 0, k2 = 1;
                }
                break;
            }
        }

        if (cnt[0] > X && cnt[2] < Z) {
            while (!pq[1].empty) {
                auto t = pq[1].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 0) {
                    pq[1].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 0, k2 = 2;
                }
                break;
            }
        }

        if (cnt[1] > Y && cnt[0] < X) {
            while (!pq[2].empty) {
                auto t = pq[2].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 1) {
                    pq[2].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 1, k2 = 0;
                }
                break;
            }
        }

        if (cnt[1] > Y && cnt[2] < Z) {
            while (!pq[3].empty) {
                auto t = pq[3].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 1) {
                    pq[3].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 1, k2 = 2;
                }
                break;
            }
        }

        if (cnt[2] > Z && cnt[0] < X) {
            while (!pq[4].empty) {
                auto t = pq[4].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 2) {
                    pq[4].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 2, k2 = 0;
                }
                break;
            }
        }

        if (cnt[2] > Z && cnt[1] < Y) {
            while (!pq[5].empty) {
                auto t = pq[5].front;
                auto i = t[0];
                auto v = t[1];
                if (pos[i] != 2) {
                    pq[5].removeFront;
                    continue;
                }
                if (v > mv) {
                    mi = i, mv = v, k1 = 2, k2 = 1;
                }
                break;
            }
        }

        cnt[k1]--;
        cnt[k2]++;
        pos[mi] = k2;
        foreach (j; 0..3) {
            int x = key[pos[mi]][j];
            if (x < 0) continue;
            pq[x].insert(tuple(mi, A[mi][j] - A[mi][pos[mi]]));
        }

    }

    long ans = 0;
    foreach (i; 0..N) ans += A[i][pos[i]];
    ans.writeln;
}
