output_description: Print the maximum possible total number of coins of all colors he gets.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X Y Z
      A_1 B_1 C_1
      A_2 B_2 C_2
      :
      A_{X+Y+Z} B_{X+Y+Z} C_{X+Y+Z}
attempt: from collections import defaultdict, deque, Counter
  from heapq import heappush, heappop, heapify
  import math
  import bisect
  import random
  from itertools import permutations, accumulate, combinations, product
  import sys
  import string
  from bisect import bisect_left, bisect_right
  from math import factorial, ceil, floor
  from operator import mul
  from functools import reduce
  
  
  sys.setrecursionlimit(2147483647)
  INF = 10**13
  
  
  def LI():
      return list(map(int, sys.stdin.readline().split()))
  
  
  def I():
      return int(sys.stdin.readline())
  
  
  def LS():
      return sys.stdin.readline().rstrip().split()
  
  
  def S():
      return sys.stdin.readline().rstrip()
  
  
  def IR(n):
      return [I() for i in range(n)]
  
  
  def LIR(n):
      return [LI() for i in range(n)]
  
  
  def SR(n):
      return [S() for i in range(n)]
  
  
  def LSR(n):
      return [LS() for i in range(n)]
  
  
  def SRL(n):
      return [list(S()) for i in range(n)]
  
  
  def MSRL(n):
      return [[int(j) for j in list(S())] for i in range(n)]
  
  
  mod = 10**9 + 7
  
  
  x, y, z = LI()
  A = []
  B = []
  C = []
  T = []
  for i in range(x + y + z):
      a, b, c = LI()
      A += [a]
      B += [b]
      C += [c]
      T += [(a, i, 0), (b, i, 1), (c, i, 2)]
  
  T.sort(reverse=True)
  D = [x, y, z]
  F = [0] * (x + y + z)
  ans = 0
  for t, j, k in T:
      if D[k] and F[j] == 0:
          ans += t
          D[k] -= 1
          F[j] = 1
  
  print(ans)
  
problem_description: Statement
  
  There are X+Y+Z people, conveniently numbered 1 through X+Y+Z. Person i has
  A_i gold coins, B_i silver coins and C_i bronze coins.
  
  Snuke is thinking of getting gold coins from X of those people, silver coins
  from Y of the people and bronze coins from Z of the people. It is not possible
  to get two or more different colors of coins from a single person. On the
  other hand, a person will give all of his/her coins of the color specified by
  Snuke.
  
  Snuke would like to maximize the total number of coins of all colors he gets.
  Find the maximum possible number of coins.
samples: [{"input": "1 2 1\n    2 4 4\n    3 2 1\n    7 6 7\n    5 2 3", "output": "18\n    \n\nGet silver coins from Person 1, silver coins from Person 2, bronze coins from\nPerson 3 and gold coins from Person 4. In this case, the total number of coins\nwill be 4+2+7+5=18. It is not possible to get 19 or more coins, and the answer\nis therefore 18.\n\n* * *"}, {"input": "3 3 2\n    16 17 1\n    2 7 5\n    2 16 12\n    17 7 7\n    13 2 10\n    12 18 3\n    16 15 19\n    5 6 2", "output": "110\n    \n\n* * *"}, {"input": "6 2 4\n    33189 87907 277349742\n    71616 46764 575306520\n    8801 53151 327161251\n    58589 4337 796697686\n    66854 17565 289910583\n    50598 35195 478112689\n    13919 88414 103962455\n    7953 69657 699253752\n    44255 98144 468443709\n    2332 42580 752437097\n    39752 19060 845062869\n    60126 74101 382963164", "output": "3093929975"}]