/*
?? 
?????? (5*5)??????????????????????? 
?????????????????????????????????not found? 
??????????????????????????????????? 
????????????4??1???????????8 ?? 
11 3 5 6 9 
12 4 7 8 10 
10 5 6 9 11 
8 6 4 7 2 
15 10 11 20 25 

 
???? 
??????5?5????
 
???? 
?????????????????????????????"not found"
 
???? 
11 3 5 6 9
12 4 7 8 10
10 5 6 9 11
8  6 4 7 2
15 10 11 20 25
 
???? 
4 1 8
 
?? 
4 1 8 

 */


int main()
{
	int a[5][5];
	int i=0,j=0,col,row;
	int max=0,count=0;

	for (i=0;i<=4;i++)
	{
		for (j=0;j<=4;j++)
		{
			cin>>a[i][j];
		}
	}





for (i=0;i<=4;i++)
{
	for (j=0;j<=4;j++)
	{
        if (max<a[i][j])
		{
			max=a[i][j];
			col=j;
			row=i;
		}

	}
            if ((max<=a[0][col])&&(max<=a[1][col])&&(max<=a[2][col])&&(max<=a[3][col])&&(max<=a[4][col])) 
			{
				cout<<row+1<<" "<<col+1<<" "<<a[row][col]<<endl;
				count++;
			}

	max=0;
}

if (count==0)    cout<<"not found"<<endl;
	return 0;

}