import java.util.Scanner;
public class Main{
public static int[][] arr = new int[20][20];
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
inputMap(scan);
int max=-1;int x=0;int y=0;
for(int i=1;i<=9;i++)
{
for(int j=1;j<=9;j++)
{
if(arr[i][j]>max)
{
max=arr[i][j];
x=i;y=j;
}
}
}
System.out.println(max);
System.out.println(x+" "+y);
scan.close();
}
public static void inputMap(Scanner scan)
{
for(int i=1;i<=9;i++)
{
for(int j=1;j<=9;j++)
{
arr[i][j] = scan.nextInt();
}
}
}
}