import java.util.*;
import java.io.*;
public class Main {
static int[][] matrix;
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
matrix = new int[10][10];
for(int i=1; i<10; i++) {
StringTokenizer st = new StringTokenizer(br.readLine(), " ");
for(int j=1; j<10; j++) {
matrix[i][j] = Integer.parseInt(st.nextToken());
}
}
bw.write(solution());
bw.flush();
bw.close();
br.close();
}
public static String solution() {
int max = 0;
int maxRow = 0;
int maxCol = 0;
for(int i=1; i<10; i++) {
for (int j=1; j<10; j++) {
if(matrix[i][j] >= max) {
max = matrix[i][j];
maxRow = i;
maxCol = j;
}
}
}
return max + "\n" + maxRow + " " + maxCol;
}
}