import java.util.Scanner
import scala.collection.mutable.Map

object Coins {
  var memo = Map.empty[(Int, Int, Int), BigInt]

  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val x = sc.nextInt
    val y = sc.nextInt
    val z = sc.nextInt
    val l = Array.ofDim[BigInt](x+y+z, 3)

    for (i <- 0 until x+y+z) {
      l(i)(0) = sc.nextInt
      l(i)(1) = sc.nextInt
      l(i)(2) = sc.nextInt
    }

    println(DP(l, x, y, z))
  }

  def DP(l: Array[Array[BigInt]], x: Int, y: Int, z: Int) : BigInt = {
    if (memo.contains((x,y,z)))
      memo((x,y,z))
    else {
      if (x == 0 && y == 0 && z == 0)
        return 0
      val pos = l.length - (x+y+z)
      val res = List[BigInt](
        if (x > 0) l(pos)(0) + DP(l, x-1, y, z) else 0,
        if (y > 0) l(pos)(1) + DP(l, x, y-1, z) else 0,
        if (z > 0) l(pos)(2) + DP(l, x, y, z-1) else 0
      ).max
      memo((x,y,z)) = res
      return res
    }
  }

}
