using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int X, Y, Z;
        public long[] A, B, C;
        public Data[] D;
        public long MOD = 1000000007;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                X = line[0];
                Y = line[1];
                Z = line[2];
            }

            int N = X + Y + Z;
            A = new long[N];
            B = new long[N];
            C = new long[N];
            for (int i = 0; i < N; i++)
            {
                var line = Input.ReadLongArray();
                A[i] = line[0];
                B[i] = line[1];
                C[i] = line[2];
            }

            long ret = 0;

            for (int i = 0; i < N; i++)
            {
                ret += A[i];
                B[i] -= A[i];
                C[i] -= A[i];
                A[i] -= A[i];
            }

            D = new Data[N];
            for (int i = 0; i < N; i++)
            {
                D[i] = new Data(B[i], C[i]);
            }

            Array.Sort(D, (d1, d2) => d1.d.CompareTo(d2.d) * (-1));

            long[] MY = new long[N];
            long[] MZ = new long[N];

            {
                long sum = 0;
                PriorityQueue<long> q = new PriorityQueue<long>((v1, v2) => v1.CompareTo(v2));
                for (int i = 0; i < Y; i++)
                {
                    q.Push(D[i].y);
                    sum += D[i].y;
                    MY[i] = sum;
                }

                for (int i = Y; i < N; i++)
                {
                    q.Push(D[i].y);
                    sum += D[i].y;
                    sum -= q.Pop();
                    MY[i] = sum;
                }
            }

            {
                long sum = 0;
                PriorityQueue<long> q = new PriorityQueue<long>((v1, v2) => v1.CompareTo(v2));
                for (int i = N - 1; i >= N - Z; i--)
                {
                    q.Push(D[i].z);
                    sum += D[i].z;
                    MZ[i] = sum;
                }

                for (int i = N - Z - 1; i >= 0; i--)
                {
                    q.Push(D[i].z);
                    sum += D[i].z;
                    sum -= q.Pop();
                    MZ[i] = sum;
                }
            }

            // Console.Error.WriteLine(ret);
            // Console.Error.WriteLine(string.Join(", ", MY));
            // Console.Error.WriteLine(string.Join(", ", MZ));

            long ret2 = long.MinValue;
            for (int i = 0; i < N; i++)
            {
                if (i < Y - 1) continue;
                if (i + Z >= N) continue;
                ret2 = Math.Max(ret2, MY[i] + MZ[i+1]);
            }

            Console.WriteLine(ret + ret2);

        }
    }

    // libs ----------
    // 比較のみ
    class Data
    {
        public long y;
        public long z;
        public long d;

        public Data(long y, long z)
        {
            this.y = y;
            this.z = z;
            this.d = y - z;
        }
    }

    public class PriorityQueue<T>
    {
        private Comparison<T> _comparison;
        private int _type = 0;

        private T[] _heap;
        private int _sz = 0;

        private int _count = 0;

        /// <summary>
        /// Priority Queue with custom comparer
        /// </summary>
        public PriorityQueue(Comparison<T> comparison)
        {
            _heap = new T[128];
            _comparison = comparison;
        }

        private int Compare(T x, T y)
        {
            return _comparison(x, y);
        }

        public void Push(T x)
        {
            _count++;
            if (_count > _heap.Length)
            {
                var newheap = new T[_heap.Length * 2];
                for (int n = 0; n < _heap.Length; n++) newheap[n] = _heap[n];
                _heap = newheap;
            }

            //node number
            var i = _sz++;

            while (i > 0)
            {
                //parent node number
                var p = (i - 1) / 2;

                if (Compare(_heap[p], x) <= 0) break;

                _heap[i] = _heap[p];
                i = p;
            }

            _heap[i] = x;
        }

        public T Pop()
        {
            _count--;

            T ret = _heap[0];
            T x = _heap[--_sz];

            int i = 0;
            while (i * 2 + 1 < _sz)
            {
                //children
                int a = i * 2 + 1;
                int b = i * 2 + 2;

                if (b < _sz && Compare(_heap[b], _heap[a]) < 0) a = b;

                if (Compare(_heap[a], x) >= 0) break;

                _heap[i] = _heap[a];
                i = a;
            }

            _heap[i] = x;

            return ret;
        }

        public int Count()
        {
            return _count;
        }

        public T Peek()
        {
            return _heap[0];
        }

        public bool Contains(T x)
        {
            for (int i = 0; i < _sz; i++) if (x.Equals(_heap[i])) return true;
            return false;
        }

        public void Clear()
        {
            while (this.Count() > 0) this.Pop();
        }

        public IEnumerator<T> GetEnumerator()
        {
            var ret = new List<T>();

            while (this.Count() > 0)
            {
                ret.Add(this.Pop());
            }

            foreach (var r in ret)
            {
                this.Push(r);
                yield return r;
            }
        }

        public T[] ToArray()
        {
            T[] array = new T[_sz];
            int i = 0;

            foreach (var r in this)
            {
                array[i++] = r;
            }

            return array;
        }
    }
    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 27808