import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner(System.in); int arr[][] = new int[3][3]; int cost = 72; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { arr[i][j] = in.nextInt(); } } int middle = arr[1][1]; if (middle != 5) { arr[1][1] = 5; cost = Math.abs(5 - middle); } } }