semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int a[5][5];
	int i,j,k,t,m;
	m=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			cin>>a[i][j];
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(a[i][j]>=a[i][0]&&a[i][j]>=a[i][1]&&a[i][j]>=a[i][2]&&a[i][j]>=a[i][3]&&a[i][j]>=a[i][4])
			{
				if(a[i][j]<=a[0][j]&&a[i][j]<=a[1][j]&&a[i][j]<=a[2][j]&&a[i][j]<=a[3][j]&&a[i][j]<=a[4][j])
				{
					k=i+1;
					t=j+1;
					cout<<k<<" "<<t<<" "<<a[i][j];
				}
				else
					m++;
			}
			else
				m++;
		}
	}
	if(m==25)
		cout<<"not found";
	 
	return 0;
}
int main()
{
	int k, s, i, j, flag2 = 0;
	int x[6][6];
	for (i = 0; i < 5; i ++)
		for (j = 0; j < 5; j ++)
			cin >> x[i][j];
	int (*p)[6] = x;
	int xx, yy;
	for (k = 0; k < 5; k ++)
		for (s = 0; s < 5; s ++)
		{
			int flag = 1;
			for (i = 0; i < 5; i ++)
				if (*(*(p + k) + i) > *(*(p + k) + s) || *(*(p + i) + s) < *(*(p + k) + s))
					flag = 0;
			if (flag)
			{
				flag2 = 1;
				xx = k;
				yy = s;
			}
		}
	if (flag2)
		cout << xx + 1 << " " << yy + 1 << " " << *(*(p + xx) + yy) << endl;
	else
		cout << "not found" << endl;
	return 0;

}
int main()
{
    int a[5][5]={0},i,j,max[5]={0},min[5]={0};
    int count=0;
    for(i=0;i<5;i++)
    for(j=0;j<5;j++)
    scanf("%d",&a[i][j]); 
    for(i=0;i<5;i++)
    {    min[i]=a[0][i];
         max[i]=a[i][0];
         for(j=0;j<5;j++)
             {
                     if(a[i][j]>max[i])max[i]=a[i][j];
                     if(a[j][i]<min[i])min[i]=a[j][i];
             }
    }
    for(i=0;i<5;i++)
    for(j=0;j<5;j++) 
    {
        if(max[i]==min[j])
        {printf("%d %d %d",i+1,j+1,max[i]);count++;} //??????????????0?? 
    }      
    if(count==0)
    printf("not found");


return 0;
}
int a[5][5];
int main()
{
    int min,max,k = 0,p,q,i,j;
    for (i = 0;i<5;i++)
    {
    	for (j = 0;j<5;j++)
    		cin>>a[i][j];
    }
    for (i = 0;i<5;i++)
    {
    	for (j = 0;j<5;j++)
    	{
    		max = a[i][j];
    		min = a[i][j];
    		for (p = 0;p<5;p++)
    		{
    			if (max<a[i][p])
    				max = a[i][p];
    		}
    		for (q = 0;q<5;q++)
    		{
    			if (min>a[q][j])
    				min = a[q][j];
    		}
    		if (a[i][j] == min&&a[i][j] == max)
    		{
    			cout<<i+1<<' '<<j+1<<' '<<a[i][j];
    			k++;
    		}
    	}
    }
    if (k == 0)
    	cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int a[5][5], i, t, m[5] = {0}, n[5] = {0}, p, flag = 0;
	for(i = 0; i<5; i++)
		for(t=0; t<5; t++)
			cin >> a[i][t];
	for(i=0; i<5; i++)
		for(t=0;t<5;t++)
		{
			if(m[i]<a[i][t])
			{
				m[i] = a[i][t]; 
				n[i] = t;
			}
		}
	for(p=0;p<5;p++)
	{
		for(i=0;i<5;i++)
		{
			if(m[p]>a[i][n[p]])
			{
				flag++;
				break;
			}
		}
		if(i==5)
			cout <<  p+1 << " " << n[p]+1 << " " <<  m[p] << endl;
	}
	if(flag==5)
		cout << "not found" << endl;
	return 0;
}
int main(){
	int O[5][5],I[5][5],J[5][5];
	memset(I,0,sizeof(I));
	memset(J,0,sizeof(J));
	for(int i=0;i<5;i++){
		for(int j=0;j<5;j++){
			cin>>O[i][j];
		}
	}
	int maxX,minY,x,y;
	for(int i=0;i<5;i++){
		maxX=0;
		minY=100000;
		x=y=0;
		for(int j=0;j<5;j++){
			if(O[i][j]>maxX){
				maxX=O[i][j];
				x=j;
			}
			if(O[j][i]<minY){
				minY=O[j][i];
				y=j;
			}
		}
		I[i][x]=1;
		J[y][i]=1;
	}
	int OK=0,OKX=0,OKY=0;

	for(int i=0;i<5;i++){
		for(int j=0;j<5;j++){
			if(I[i][j]&&J[i][j]){
				OK=1;
				OKX=i+1;
				OKY=j+1;
				break;
			}
		}
	}
	if(OK) cout<<OKX<<' '<<OKY<<' '<<O[OKX-1][OKY-1];
	else cout<<"not found";
	return 0;
}
int main()
{
	int a[5][5];
	int i,j,max,min,k,l=0,p;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<5;i++)
	{
            p=0;
			max=a[i][0];
		for(j=1;j<5;j++)
		{
			
			if(max<a[i][j]){
				max=a[i][j];
				p=j;
			}
		}
         min=a[0][p];
		for(k=0;k<4;k++)
			if(min>a[k+1][p])
				min=a[k+1][p];
		if(max==min)
		{printf("%d %d %d",i+1,p+1,a[i][p]);
		l++;
		}
		else continue;
	}
		if (l==0)
		{printf("not found");}
		return 0;
}
/**
* ???1000012847
* ??????
* ???????
* ????????? (5*5)??????????????????????? 
* ?????????????????????????????????not found?
**/
 
int main()
{
	//??????a[5][5]???????i?j????????max[5]?min[5]???????????????????f??????
	int a[5][5] , i , j , max[5] = {0} , min[5] = {2147483647 , 2147483647 , 2147483647 , 2147483647 , 2147483647} , f = 0;
	
	for (i = 0; i < 5; i ++)
	{
		for (j = 0; j < 5; j ++)
		{
			cin >> a[i][j];                                      //????????5*5???
			if (max[i] < a[i][j])                      //?????????a[i][j],??a[i][j]???????
				max[i] = a[i][j];
			if (min[j] > a[i][j])                      //?????????a[i][j],??a[i][j]???????
				min[j] = a[i][j];
		}
	}
	
	for (i = 0; i < 5; i ++)
	{
		for (j = 0; j < 5; j ++)
		{
			if (min[j] == max[i] && a[i][j] == min[j])           //??i?????j?????a[i][i]??
			{
				cout << i + 1 << " " << j + 1 << " " << a[i][j]; //??????i+1?????j+1???
				f = 1;                                           //????????1
			}
		}
	}
	
	if (f == 0)                                                  //???????0
		cout << "not found" << endl;                             //???not found
	
	return 0;
}
int main()
{
	int a[5][5];
	int i,j,m,n,x=1;
	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++)
			{  int w=1,v=1;
				for(m=0;m<=4;m++)
					if(a[i][j]<a[i][m]){w=0;break;}
				for(n=0;n<=4;n++)
					if(a[i][j]>a[n][j]){v=0;break;}
				if(w&&v) {cout<<i+1<<" "<<j+1<<" "<<a[i][j]<<endl;x=0;}
			}
	if(x)cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int i,k=0,j;
	int a[5][5]={0},b[5];
   for(i=0;i<5;i++)
	   {for(j=0;j<5;j++)
	   scanf("%d",&a[i][j]);}
   for(i=0;i<5;i++)
	   {for(j=0;j<5;j++)
	   if(a[i][j]<=a[1][j]&&a[i][j]<=a[2][j]&&a[i][j]<=a[3][j]&&a[i][j]<=a[4][j]&&a[i][j]<=a[0][j]&&a[i][j]>=a[i][0]&&a[i][j]>=a[i][1]&&a[i][j]>=a[i][2]&&a[i][j]>=a[i][3]&&a[i][j]>=a[i][4])
 { k=k+1;
   printf("%d %d %d\n",i+1,j+1,a[i][j]);}
   }
   if(k==0)
	   printf("not found\n");
}
int main()
{
	int i,j,k=0,matrix[5][5],max[5],min[5];
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&matrix[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		max[i]=matrix[i][0];
		min[i]=matrix[0][i];
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(matrix[i][j]>max[i])
			{
				max[i]=matrix[i][j];
			}
		}
	}
	for(j=0;j<5;j++)
	{
		for(i=0;i<5;i++)
		{
			if(matrix[i][j]<min[j])
			{
				min[j]=matrix[i][j];
			}
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(max[i]==min[j])
			{
				k=1;
				printf("%d %d %d",i+1,j+1,min[j]);
			}
		}
	}
	if(k==0)
	{
		printf("not found");
	}
	return 0;
}
int main()
{
	int a[5][5],i,j,k,row[5],col[5],ro,column;
	for (i=1;i<=5;i++)
	{
		for (j=1;j<=5;j++)
			scanf("%d",&a[i-1][j-1]);
	}
	for (i=1;i<=5;i++)
	{
		col[i-1]=a[0][i-1];
		row[i-1]=a[i-1][0];
	}
	for (i=1;i<=5;i++)                //????????//
	{
		for (j=1;j<=5;j++)
		{
			if (a[i-1][j-1]>row[i-1])
				row[i-1]=a[i-1][j-1];
		}
	}
	for (j=1;j<=5;j++)              //????????//
	{
		for (i=1;i<=5;i++)
		{
			if (a[i-1][j-1]<col[j-1])
				col[j-1]=a[i-1][j-1];
		}
	}
	int exist=0;                   //?????????????//
	for (column=1;column<=5;column++)
	{
		for(ro=1;ro<=5;ro++)
		{	
			if (col[column-1]==row[ro-1])
			{
				printf("%d %d %d\n",ro,column,col[column-1]);
				exist=1;           //??????//
			}
		}
	}
	if (exist==0)
		printf("not found");
	return 0;
}
int main()
{
	int a[5][5],i,j,l;
	int num=0;

	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>a[i][j];
	for(i=0;i<5;i++)
			for(j=0;j<5;j++)
				//???????????
			{ int p=0;
				for(l=0;l<5;l++)
				{
				 if((a[l][j]<a[i][j])||(a[i][l]>a[i][j]))//??a[i][j]??????????????
				   {
				   p++;
				   break;
				   }
			     }

				if(p==0){cout<<i+1<<" "<<j+1<<" "<<a[i][j]<<endl;
						num++;}//??num???
			}
	if(num==0)cout<<"not found"<<endl;
}
/**
* @file 1000012853_1
* @author 1000012853 ??
* @date 2010?11?05
* @desc ????
*/
int main()
{
	int i, j, row, column, m;
	int a[5][5], b[5] = {0};
	for (i = 0; i < 5; i ++)
	{
		for (j= 0; j < 5; j ++)
		{
			cin >> a[i][j];
		}
	}
	for (i = 0; i < 5; i ++)
	{
		m = a[i][0];
		row = i;
		column = 0;
		for (j = 0; j < 5; j ++)
		{   int flag = 0;
			if (a[i][j] > m)
			{
				m = a[i][j];
				row = i;
				column = j;
			}
			if (j == 4)
			{
			for (int k = 0; k < 5; k ++)
			{
				if (k != row && m > a[k][column])
				{   flag = 1;
				    break;
				}
			}
				if ( flag == 0)
				{
				   cout << row + 1 <<' '<< column + 1 <<' '<< a[row][column] << endl;
				   b[i] = 1;
				}
			}
		}
	}
	if ((b[0] + b[1] + b[2] + b[3] + b[4]) == 0)
	{
	    cout << "not found" << endl;
	}
	return 0;
}
int main()
{
int a[5][5],b[5][5],c[5][5],max[5],min[5];
int i,j,i1,i2,i3,i4,i5,i6,i7,i8,m,n,p=0,prin;
for(i=0;i<=4;i++)
{
	for(j=0;j<=4;j++)
	{
		scanf("%d",&a[i][j]);
		b[i][j]=a[i][j];
		c[i][j]=a[i][j];
	}
}
 for(i1=0;i1<=4;i1++)
 {
   for(i2=1;i2<=4;i2++)
  {
   for(i3=0;i3<=3;i3++)
   {
	 if(b[i1][i3]<b[i1][i3+1])
	   {m=b[i1][i3+1];
	    b[i1][i3+1]=b[i1][i3];
	    b[i1][i3] =m;}
   }
  }
 max[i1]=b[i1][0];
 }
  for(i4=0;i4<=4;i4++)
 {
   for(i5=1;i5<=4;i5++)
  {
   for(i6=0;i6<=3;i6++)
   {
	 if(c[i6][i4]>c[i6+1][i4])
	   {n=c[i6+1][i4];
	    c[i6+1][i4]=c[i6][i4];
	    c[i6][i4] =n;}
   }
  }
 min[i4]=c[0][i4];
  }
   for(i7=0;i7<=4;i7++)
 {
  for(i8=0;i8<=4;i8++)
  {
   if((max[i7]==min[i8]))
   {   prin=max[i7];
	   i7=i7+1;i8=i8+1;
	   printf("%d %d %d\n",i7,i8,prin);p=p+1;}
  }
 }
 if(p==0)
 printf("not found");
}
int main()
{
	int f[5][5];
	int a,b,c,d,i,j;
	c=0;
	d=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&f[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			for(a=0;a<5;a++)
			{
				for(b=0;b<5;b++)
				{
					if(f[i][j]>=f[i][a]&&f[i][j]<=f[b][j])
			{
				c++;
				if(c==25)
			{
				d=1;
				printf("%d %d %d",i+1,j+1,f[i][j]);
				break;
			}
			}
					else
					{
						c=0;
					}
				}
			}
		}
	}
	if(d==0)
		printf("not found");
	return 0;
}
int main()
{
	int point[6][6],i,j,biaoji=0;
	for(i=1;i<6;i++)
		for(j=1;j<6;j++)
			cin>>point[i][j];//????
	int max=0,c,b;
	for(i=1;i<6;i++)
	{
		max=0;//???max
		for(j=1;j<6;j++)
		{
			if(point[i][j]>max)
			{
				max=point[i][j];//???????
				b=i;//????
				c=j;//????
			}
		}
		int count=0,a;
		for(a=1;a<6;a++)
		{
			if(max<point[a][c])//?????????????????
				count=count+1;
		}
		if(count==4)
		{
			cout<<b<<" "<<c<<" "<<max<<endl;
			biaoji=1;//????????1
		}
	}
	if(biaoji==0)//?????????
		cout<<"not found"<<endl;
return 0;
}
int main()
{
	int i,j,a[5][5],m,n,k,re=0,max,tap=0;
	for (i=0;i<5;i++)
		
	{
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
		
	}
	

	for(i=0;i<5;i++)
	{
		k=0;re=0;
		max=a[i][0];
	    for(j=1;j<5;j++)
		{
			if(a[i][j]>max)
			{
				max=a[i][j];
				k=j;
			}
		}
		    for(n=0;n<5;n++)
			{ 
				if(max>a[n][k])
			re=1;
				
			    
			
			}

		
	if (re==0)
	{tap=1;
		printf("%d %d %d",i+1,k+1,max);
	}
	}
	if (tap==0)
		printf("not found");

	
	return 0;

}
int main(){ 
	int p,q,y;
    int sz[5][5];
    for(int row=0;row<5;row++){
		for(int col=0;col<5;col++){
            scanf("%d",&sz[row][col]);
		}
	}
	

	y=0;
	
	for(int row=0;row<5;row++){
		for(int col=0;col<5;col++){
			p=0;
			q=0;
            for(int m=0;m<5;m++){
				if(m!=col&&sz[row][col]>sz[row][m]){
				   p+=1;
				}
				if(m!=row&&sz[row][col]<sz[m][col]){
				   q+=1;
				}
			}
						if(p==4&&q==4){
				printf("%d %d %d",row+1,col+1,sz[row][col]);
                y+=1;
		
			}
		}
    }
	
	if(y==0){
		printf("not found");
   
		}

    return 0; 
  }
/*
 * 11.cpp
 *
 *  Created on: 2011-11-4
 *      Author: 11095
 */

int main()
{
	int jz[5][5];
	int i,j,I,J,p=0,max;
	for(i=0;i<5;i++){
		for(j=0;j<5;j++){
			cin>>jz[i][j];
		}
	}

	for(i=0;i<5;i++){
		max=jz[i][0];
		I=i;J=0;
		for(j=1;j<5;j++){
			if(max<jz[i][j]) {
				max=jz[i][j];
				I=i;J=j;
			}
		}
		if(max<=jz[0][J]&&max<=jz[1][J]&&max<=jz[2][J]&&max<=jz[3][J]&&max<=jz[4][J]){
			I=I+1;J=J+1;p=1;
			cout<<I<<" "<<J<<" "<<max;
		}
	}

	if(p==0)cout<<"not found"<<endl;
	return 0;
}
int main(){
int a[10][10],i,j,m,n,x[10],c[10],d[10];

for(i=0;i<5;i++){
	x[i]=0;
	for(j=0;j<5;j++){
		scanf("%d",&a[i][j]);
		if(a[i][j]>x[i]){
		x[i]=a[i][j];}	
	}
}
for(i=0;i<5;i++){
	for(j=0;j<5;j++){
		if(a[i][j]==x[i]){//c[i]=i;
		d[i]=j;
		//printf("%d\n",a[i][j]);
		//printf("%d",d[i]);
		}
	}
}
n=0;
for(i=0;i<5;i++){
   m=d[i];
   if(a[i][m]<=a[0][m]&&a[i][m]<=a[1][m]&&a[i][m]<=a[2][m]&&a[i][m]<=a[3][m]&&a[i][m]<=a[4][m]){
   c[i]=1;
   }else{c[i]=0;}
   n=n+c[i];
}

if(n==0){printf("not found");}else{
for(i=0;i<5;i++){
	m=d[i];
	if(c[i]==1){printf("%d %d %d\n",i+1,m+1,a[i][m]);
	}
}
}

return 0;
}
int main()
{
	int a[6][6],i,j,flag1=0,flag2=0,flag=0,x,y,k;
    for(i=1;i<6;i++)
	{
		for(j=1;j<6;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
		for(i=1;i<6;i++)
		{
			for(j=1;j<6;j++)
			{
				if(a[i][j]>=a[i][1]&&a[i][j]>=a[i][2]&&a[i][j]>=a[i][3]&&a[i][j]>=a[i][4]&&a[i][j]>=a[i][5]&&a[i][j]<=a[1][j]&&a[i][j]<=a[2][j]&&a[i][j]<=a[3][j]&&a[i][j]<=a[4][j]&&a[i][j]<=a[5][j])
				{
					flag=-1;
					x=i;
					y=j;
				}
			}
		}
		if(flag==-1)
			printf("%d %d %d",x,y,a[x][y]);
		else
			printf("not found");
	return 0;
}
int main()
{
	int a[5][5],i,j,k,p,m,n,s=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	}
	m=a[0][0];k=0;
	for(j=0;j<5;j++)
	{
		if(a[0][j]>m)
		{
			m=a[0][j];
			k=j;
		}
		else;
	}
	n=a[0][k];p=0;
	for(i=0;i<5;i++)
	{
		if(a[i][k]<n)
		{
			n=a[i][k];
			p=i;
		}
		else;
	}
	if(p==0)
		printf("1 %d %d",k+1,a[0][k]);
	else
		s++;

    m=a[1][0];k=0;
	for(j=0;j<5;j++)
	{
		if(a[1][j]>m)
		{
			m=a[1][j];
			k=j;
		}
		else;
	}
	n=a[0][k];p=0;
	for(i=0;i<5;i++)
	{
		if(a[i][k]<n)
		{
			n=a[i][k];
			p=i;
		}
		else;
	}
	if(p==1)
		printf("2 %d %d",k+1,a[1][k]);
	else
		s++;

	m=a[2][0];k=0;
	for(j=0;j<5;j++)
	{
		if(a[2][j]>m)
		{
			m=a[2][j];
			k=j;
		}
		else;
	}
	n=a[0][k];p=0;
	for(i=0;i<5;i++)
	{
		if(a[i][k]<n)
		{
			n=a[i][k];
			p=i;
		}
		else;
	}
	if(p==2)
		printf("3 %d %d",k+1,a[2][k]);
	else
		s++;

	m=a[3][0];k=0;
	for(j=0;j<5;j++)
	{
		if(a[3][j]>m)
		{
			m=a[3][j];
			k=j;
		}
		else;
	}
	n=a[0][k];p=0;
	for(i=0;i<5;i++)
	{
		if(a[i][k]<n)
		{
			n=a[i][k];
			p=i;
		}
		else;
	}
	if(p==3)
		printf("4 %d %d",k+1,a[3][k]);
	else
		s++;

    m=a[4][0];k=0;
	for(j=0;j<5;j++)
	{
		if(a[4][j]>m)
		{
			m=a[4][j];
			k=j;
		}
		else;
	}
	n=a[0][k];p=0;
	for(i=0;i<5;i++)
	{
		if(a[i][k]<n)
		{
			n=a[i][k];
			p=i;
		}
		else;
	}
	if(p==4)
		printf("5 %d %d",k+1,a[4][k]);
	else
		s++;
	if(s==5)
		printf("not found");
	return 0;
}
/*?????? (5*5)??????????????????????? 
?????????????????????????????????not found? 
???????????????????????????????????*/
void main(){
	int m[5][5],r[5],l[5],i,j,k;
	for(i=0;i<5;i++){
		k=0;
		for(j=0;j<5;j++){
			scanf("%d",&m[i][j]);
			if(m[i][j]>m[i][k]) k=j;
		}
		r[i]=k;
	}
	for(j=0;j<5;j++){
		k=0;
		for(i=0;i<5;i++) if(m[i][j]<m[k][j]) k=i;
		l[j]=k;	
	}
	for(i=0;i<5;i++) if(l[r[i]]==i) break;
	if(i==5) printf("not found");
	else printf("%d %d %d",i+1,r[i]+1,m[i][r[i]]);
}
//****************************************
//*???????                       **
//*????? 1100012780     	        **
//*???2011.10.27                     **
//****************************************
int main()
{
	int line,column,i,j,min,max,flag = 0;//line???????????column???????????i,j??????
									 //max,min????????????,flag?????????
	int a[5][5];
	for (i = 0;i <= 4;i++)//????
	{
		for (j = 0;j <= 4;j++)
			cin>>a[i][j];
	}
	for (j = 0;j <=4;j++)
	{
		min = a[0][j];
		for (i = 0;i <= 4;i++)//??????????????line????????
		{
			if(a[i][j] <= min)
			{
				min = a[i][j];
				line = i;
			}
		}
		max = a[line][j];
		for (i = 0;i <=4;i++)//??line???????????column???????
		{
			if (a[line][i] >= max)
			{
				max = a[line][i];
				column = i;
			}
		}
		if (max == min)//?????????????????????????????+1
		{
			cout<<line + 1<<" "<<column + 1<<" "<<a[line][column];
			flag = 1;
		}
	}
	if (flag == 0)
		cout<<"not found";
	return 0;
}
main()
{
      int a[5][5];
      int i,j;
      int x,y,z,w,s,q,p=0;
      for(i=0;i<5;i++)
      {
        for(j=0;j<5;j++)
        {
           scanf("%d",&a[i][j]);
        }
      }
      for(i=0;i<5;i++)
      {
        for(j=0;j<5;j++)
        {
           w=a[i][j];
           x=i;y=j;
           for(s=0;s<5;s++)
           {if(a[i][s]>=w)
            w=a[i][s];}
           if(w==a[i][j])
             { q=a[i][j];
               for(s=0;s<5;s++)
               {if(a[s][j]<=q)
                 q=a[s][j];}
                  if(q==a[i][j])
                    {printf("%d %d %d\n",x+1,y+1,w);  
                     p=p+1;} 
             }
        }   
      }
       if(p==0)
       printf("not found"); 
       
}
int main()
{
	int a[5][5];
	int i,j,k,flag[5][5],prime=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			cin>>a[i][j];
			flag[i][j]=1;
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			for(k=0;k<5;k++)
			{
				if(k==j) continue;
				else
					if(a[i][j]<a[i][k])
					{
						flag[i][j]=0;
						break;
					}
			}
		}
		for(j=0;j<5;j++)
		{
			if(flag[i][j]==1)
			{
				for(k=0;k<5;k++)
				{
					if(k==i) continue;
					else
						if(a[i][j]>a[k][j])
						{
							flag[i][j]=0;
							break;
						}
				}
			}
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(flag[i][j]==1)
			{
				cout<<i+1<<' '<<j+1<<' '<<a[i][j]<<endl;
				prime=1;

			}
		}
	}
	if(prime==0)
		cout<<"not found";
	return 0;
}
main()
{
    int i,j,c=0;
    int a[5][5]={0},result[5][5]={0};
    int temp,tempi,tempj;
    for (i=0;i<5;i++)
    for (j=0;j<5;j++)
    {
        scanf("%d",&a[i][j]);
    }
    //??i??????????result[5][5]?
    for (i=0;i<5;i++)
    {
        tempj=0;
        temp=a[i][0];
        for (j=1;j<5;j++)
        if (a[i][j]>temp)
        {
            temp=a[i][j];
            tempj=j;
        }
        result[i][tempj]=1;
    }
    //??j??????
    for (j=0;j<5;j++)
    {
        tempi=0;
        temp=a[0][j];
        for (i=1;i<5;i++)
        if (a[i][j]<temp)
        {
            temp=a[i][j];
            tempi=i;
        }
        result[tempi][j]++;
        if (result[tempi][j]==2)
        {printf("%d %d %d",tempi+1,j+1,a[tempi][j]);
        c=1;}
    }
    if (c==0)
    printf("not found");

}
// ??.cpp : ??????????????
//

void main() 
{ 
int i,j,k=0; 
int a[5][5],max[5],min[5]; 
for(i=0;i<5;i++) 
for(j=0;j<5;j++) 
scanf("%d",&a[i][j]); 
for(i=0;i<5;i++)max[i]=a[i][0];
for(j=0;j<5;j++)min[j]=a[0][j];
for(i=0;i<5;i++)
{
  for(j=0;j<5;j++)
        {
            if(a[i][j]>max[i])max[i]=a[i][j];
            if(a[i][j]<min[j])min[j]=a[i][j];
        }
}
for(i=0;i<5;i++)
    {
   for(j=0;j<5;j++)
      {   
            if(max[i]==min[j])
            {printf("%d %d %d",i+1,j+1,a[i][j]);
             k++;}
       }
    }
 if(k==0)  printf("not found");
}
int main()
{
	int a[5][5];
	int hang=0,lie=0,p=-1;
	int i,j;
	for(i=0;i<=4;i++)
	{
		for(j=0;j<=4;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<=4;i++)
	{
		for(j=0;j<=4;j++)
		{
			if(a[i][j]>=a[i][0]&&a[i][j]>=a[i][1]&&a[i][j]>=a[i][2]&&a[i][j]>=a[i][3]&&a[i][j]>=a[i][4]&&a[i][j]<=a[0][j]&&a[i][j]<=a[1][j]&&a[i][j]<=a[2][j]&&a[i][j]<=a[3][j])
			{
				p=a[i][j];
				hang=i+1;
				lie=j+1;
				printf("%d %d %d\n",hang,lie,p);
			}
		}
	}
	if(p==-1)
		printf("not found\n");
	return 0;
}
//***************************************************
//*    name: 4.cpp                                  *
//*    author:??                                  *
//*    date: 2013-11-01                             *
//*    description:????                         *
//***************************************************
int main()
{
	int a[6][6]={0},max=INT_MIN , min=INT_MAX,maxl,minh,i , j , k ,truth=0;
	for(i = 1;i < 6;i++)
	{
		for(j = 1 ; j < 6 ; j++)
			cin >> a[i][j] ;
	}
	for(i = 1 ; i < 6 ;i++)
	{
		for(j = 1 ; j < 6 ; j++)
		{
			if(max<a[i][j])
			{
				max = a[i][j];
				maxl =j ;
			}
		}
		for(k = 1 ; k < 6 ; k++)
		{
			if(min > a[k][maxl])
			{
				min= a[k][maxl];
				minh = k ;
			}
		}
		if(max == min)
		{
			truth = 1 ;
			cout << minh <<' '<< maxl <<' '<< a[minh][maxl] ;
		}
		max =INT_MIN  ;
		min =INT_MAX;
	}
	if(truth == 0)
		cout <<"not found"<<endl;
	return 0 ;
}
int main()
{
	int a[5][5], i, j, max[5], min[5], max1, min1, place1[5], place2[5], leap = 1;
	for(i = 0; i <= 4; i++)
	{
		for(j = 0; j <= 4; j++)
		{
			cin >> a[i][j];
		}
	}
	for(i = 0; i <= 4; i++)
	{
		max1 = 0;
		for(j = 0; j <= 4; j++)
		{
			if(a[i][j] > max1)
			{
				max1 = a[i][j];
				place1[i] = j;
			}
		}
		max[i] = max1;
	}
	for(j = 0; j <= 4; j++)
	{
		min1 = max[j];
		place2[j] = j;
		int p = place1[j];
	    for(i = 0; i <= 4; i++)
	    {
		    if(a[i][p] < min1)
		    {
			    min1 = a[i][p];
				place2[j] = i;
		    }
		}
		min[j] = min1;
	}
	for(i = 0; i <= 4; i++)
	{
		if(max[i] == min[i])
		{
			cout << place2[i] + 1 << " " << place1[i] + 1 << " " << max[i] << endl;
			leap = 0;
		}
	}
	if(leap == 1)
		cout << "not found" << endl;
	return 0;
}
int main()
{
int i,j,k,max,temp,flag;
int a[5][5];
for(i=0;i<=4;i++)
  for(j=0;j<=4;j++)
	scanf("%d",&a[i][j]);
for(i=0;i<=4;i++)
   {
                max=a[i][0];
                flag=1;
               for(j=0;j<=4;j++)
               {
                            if(a[i][j]>=max)
                           { max=a[i][j];
                               temp=j;}
                }
               for(k=0;k<=4;k++)
             { 
                                if( a[k][temp]<max)
                              {flag=0;
                                break;
							}
              }
       if( flag==1)
      {
      printf("%d %d %d",i+1,temp+1,a[i][temp]);
      break;
      }
    }
         if (!flag)
         printf("not found");
    return 0; 
}
int main(){	
int h,z,s;	
s=0;	
int sz[5][5],max[5],min[5];	
for(h=0;h<5;h++)	{	
	for(z=0;z<5;z++)	
	{			scanf("%d",&sz[h][z]);		}	}		for(h=0;h<5;h++){			
max[h]=sz[h][0];			
for(z=0;z<5;z++){			
	if(sz[h][z]>max[h]){		
		max[h]=sz[h][z];	
			}	
		}		
}		
for(z=0;z<5;z++){		
	min[z]=sz[0][z];	
		for(h=0;h<5;h++){	
			if(sz[h][z]<min[z]){	
			min[z]=sz[h][z];	
			}			
}	
	}	
for(h=0;h<5;h++){		
for(z=0;z<5;z++){		
	if(min[z]==max[h]){	
			printf("%d %d %d",h+1,z+1,max[h]);
				s++;		
	}	
	}
	}	
if(s==0){		
printf("not found");	}	
return 0;
}
int main()
{
	int a[5][5], i, j, t = 0, col, g = 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 (t < a[i][j])
				{
					t = a[i][j];
					col = j;
				}
			}
		    if (t <= a[0][col] && t <= a[1][col] && t <= a[2][col] && t <= a[3][col] && t <= a[4][col])
			{
				cout << i + 1 << " " <<  col + 1 << " " <<  t << endl;
			}
			else
			{
				t = 0;
				g ++;
			}
		}
		if (g == 5)
		{
			cout << "not found" << endl;
		}
		return 0;
}
int main()
{
	int out[5][5]={{0}};        //???????
	int judge=0,jusum=0;        //judge?????????,jusum??????????
	int max=0,mplace=0;         //max??????mplace????????
	int i,j,k;                  //i,j?????
	for(i=0;i<5;i++)            //????out
	{
		for(j=0;j<5;j++)
			cin>>out[i][j];
	}
	for(i=0;i<5;i++)             //???
	{
		max=out[i][0];
		mplace=0;
		for(j=1;j<5;j++)
		{
			if(max<out[i][j])
			{
				max=out[i][j];
				mplace=j;
			}
		}
		for(j=0;j<5;j++)
		{
			if(out[j][mplace]<max)
				judge=1;
		}
		if(judge==0)
		{
			i++;
			mplace++;
			cout<<i<<' '<<mplace<<' ';
			i--;
			mplace--;
			cout<<out[i][mplace];
			jusum=1;
		}
		judge=0;
	}
	if(jusum==0)
		cout<<"not found";
	return 0;
}
/**  
* @file   ???? .cpp  
* @author ??? 
* @date   2013-11-01  * @description 
*          ??????:????   */ 
int main()
{
	int a[5][5];
	int number;
	int t=0 ;
	for(int i=0;i<5;i++)
	{
		for (int j=0;j<5;j++)
		{
			cin>>number;
			a[i][j]=number;
		}
	}
	int max=INT_MIN,maxi,maxj;
	for(int i=0;i<5;i++)
	{
		max=INT_MIN;
		for(int j=0;j<5;j++)
		{
			if (a[i][j]>max)
			{
				max=a[i][j];
				maxi=i;
				maxj=j;
			}
		}
		int k=0 ;
		for(;k<5;k++)
		{
			if(a[k][maxj]<max)
				break;
		}
		if(k==5)
		{
			cout<<(maxi+1)<<" "<<(maxj+1)<<" "<<max;
			t++;
		}
	}
	if(t==0)
		cout<<"not found"<<endl;
	return 0;
}