{"raw_statement":[{"iden":"problem statement","content":"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.\nSnuke 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.\nSnuke would like to maximize the total number of coins of all colors he gets. Find the maximum possible number of coins."},{"iden":"constraints","content":"*   $1 \\leq X$\n*   $1 \\leq Y$\n*   $1 \\leq Z$\n*   $X+Y+Z \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^9$\n*   $1 \\leq B_i \\leq 10^9$\n*   $1 \\leq C_i \\leq 10^9$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$X$ $Y$ $Z$\n$A_1$ $B_1$ $C_1$\n$A_2$ $B_2$ $C_2$\n$:$\n$A_{X+Y+Z}$ $B_{X+Y+Z}$ $C_{X+Y+Z}$"},{"iden":"sample input 1","content":"1 2 1\n2 4 4\n3 2 1\n7 6 7\n5 2 3"},{"iden":"sample output 1","content":"18\n\nGet silver coins from Person $1$, silver coins from Person $2$, bronze coins from Person $3$ and gold coins from Person $4$. In this case, the total number of coins will be $4+2+7+5=18$. It is not possible to get $19$ or more coins, and the answer is therefore $18$."},{"iden":"sample input 2","content":"3 3 2\n16 17 1\n2 7 5\n2 16 12\n17 7 7\n13 2 10\n12 18 3\n16 15 19\n5 6 2"},{"iden":"sample output 2","content":"110"},{"iden":"sample input 3","content":"6 2 4\n33189 87907 277349742\n71616 46764 575306520\n8801 53151 327161251\n58589 4337 796697686\n66854 17565 289910583\n50598 35195 478112689\n13919 88414 103962455\n7953 69657 699253752\n44255 98144 468443709\n2332 42580 752437097\n39752 19060 845062869\n60126 74101 382963164"},{"iden":"sample output 3","content":"3093929975"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}