import java.util.*; public class Main { public static void main(String[] args) { // write your code here Scanner sc = new Scanner(System.in); int count,tmp,min; int i,j; String result; while(true){ count = tmp = 0; min = Integer.MAX_VALUE; result = ""; if(!sc.hasNext()) { break; } int[] B = new int[3]; int[] G = new int[3]; int[] C = new int[3]; B[0] = sc.nextInt(); G[0] = sc.nextInt(); C[0] = sc.nextInt(); B[1] = sc.nextInt(); G[1] = sc.nextInt(); C[1] = sc.nextInt(); B[2] = sc.nextInt(); G[2] = sc.nextInt(); C[2] = sc.nextInt(); //BCG tmp = G[0] + C[0] + B[1] + B[2] + G[1] + C[2]; if(tmp