semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int num[6][6];
    int i, j, k, l = 0;
    for ( i = 1; i < 6; i++ )
        for ( j = 1; j < 6; j++ )
            cin >> num[i][j];
    int max, row, line;
    for ( i = 1; i < 6; i++ )
    {
        max = num[i][1];
        line = 1;
        for ( j = 1; j < 6; j++ )
        {
            if ( max < num[i][j] )
            {
                 max = num[i][j];
                 line = j;
            }
        }
        int p = 0;
        for ( k = 1; k < 6; k++ )
        {
            if ( max > num[k][line] )
            {
                 p = 1;
                 break;
            }
        }
        if ( p == 0 )
        {
             cout << i << " " << line << " " << num[i][line] << endl;
             l = 1;
        }
    }
    if ( l == 0 )
       cout << "not found" << endl;
    return 0;
}
int main()
{
 int a[5][5],max,h,l,sum,s=0;
 int i,j,k;
 
 for(i=0;i<5;i++){
	 for(j=0;j<5;j++){
		 scanf("%d",&a[i][j]);
	 }
 }
 
 for(i=0;i<5;i++){
	 
	 sum=0;
	 max=a[i][0];
	 h=i;
	 l=0;
     for(j=0;j<5;j++){
		 if(max<a[h][j]){
			 max=a[h][j];
			 l=j; 
		 }
	 }
     
	 for(k=0;k<5;k++){
	      if(max<=a[k][l]){
			   sum++;
		  }
	 }
	 
	 if(sum==5){
				 printf("%d %d %d",h+1,l+1,a[h][l]);
				 return 0;
			 }
 }
	    
 printf("not found");
 return 0;
}
//************************************************************
//*????????? ****************************************
//*??????? 1200012979 *********************************
//*??:2012.11.6 ********************************************
//************************************************************
int main()
{
	int m[6][6] , x1[6] , y1[6] , x2[6] , y2[6] ,
		h[6] , l[6] , i , k ,  n , j = 0 ;
	for ( i = 1 ; i <= 5 ; i++ )
		for ( k = 1 ; k <= 5 ; k++ ) 
			cin >> m[i][k] ;
	for ( i = 1 ; i <= 5 ; i++ )
	{
        h[i] = m[i][1] ;
		x1[i] = i ;
		y1[i] = 1 ;
		for ( k = 1 ; k <= 5 ; k++ ) //h[i]???????
		{                            
			
			if ( m[i][k] > h[i] )
			{
				h[i] = m[i][k] ;
				x1[i] = i ;          //x1?????
				y1[i] = k ;          //y1?????
			}
		}
	}
	for ( k = 1 ; k <= 5 ; k++ )
	{
		l[k] = m[1][k] ;             //l[k]???????
		x2[k] = 1 ;
		y2[k] = k ;
		for ( i = 2 ; i <= 5 ; i++ )
		{
			if ( m[i][k] < l[k] )
			{
				l[k] = m[i][k] ;
				x2[k] = i ;          //??????
				y2[k] = k ;
			}
		}
	}
	for ( n = 1 ; n <= 5 ; n++ )
    {
		if ( h[n] == l[y1[n]] )
			if ( x1[n] == x2[y1[n]] )
				if ( y1[n] == y2[y1[n]] )
				{
					cout << x1[n] << " " << y1[n] << " " << h[n] ;
					j++ ;
				}
	}
	if ( j == 0 )                    //j???????0?????
		cout << "not found" << endl ;
	return 0 ;
}
int main()
{
int a[5][5],s,max[5],min[5];
s=0;
for(int i=0;i<5;i++){
        for(int j=0;j<5;j++){
                scanf("%d",&a[i][j]);
                }
             }
max[0]=a[0][0];
max[1]=a[1][0];
max[2]=a[2][0];
max[3]=a[3][0];
max[4]=a[4][0];
min[0]=a[0][0];
min[1]=a[0][1];
min[2]=a[0][2];
min[3]=a[0][3];
min[4]=a[0][4];
for(int i=0;i<5;i++){
          for(int 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(int i=0;i<5;i++){
          for(int j=0;j<5;j++){
                  if(a[i][j]==max[i]&&a[i][j]==min[j]){
                  printf("%d %d %d\n",i+1,j+1,a[i][j]);                  
                                                       }
                  else{
                     s++;  
                       }
                  }
                  }   
if(s==25){
          printf("not found");
          }          
return 0;
}
int main()
{ int i,j,m,n,t,a[5][5],k;
 for(i=0;i<=4;i++)
 { for(j=0;j<=4;j++)
 { cin>>a[i][j];}}
 int *p;
 p=&a[0][0];
 n=0;
 for(;p<&a[0][0]+25;p++)
 { m=0;
 t=(p-&a[0][0])%5;
 k=(p-&a[0][0])/5;
	 for(i=0;i<=4;i++)
	 { 
	   if((*(*(a+i)+t))<*p)
	   {m++;}
	   if( *(*(a+k)+i)>*p)
	   {m++;}
	 
	 }  if(m==0)
		   {   t++; k++;
			   cout<<k<<" "<<t<<" "<<*p<<endl;
	   n++;}
 }
 if(n==0)
 {cout<<"not found";}
return 0;}
main ()
{
     int a[5][5],b[5][5],c[5][5],i,j,t,m,count=0,q,w;
     for (i=0;i<5;i++)
     for (j=0;j<5;j++)
     {
         scanf ("%d",&a[i][j]);
         b[i][j]=100000;
         c[i][j]=100000;
     }
     for (i=0;i<5;i++)
     {
         t=a[i][0];m=0;
         for (j=0;j<5;j++)
         {
             if (a[i][j]>t) {t=a[i][j];m=j;}
         }
          b[i][m]=t;
     }
     for (j=0;j<5;j++)
     {
         t=a[0][j];m=0;
         for (i=0;i<5;i++)
         {
             if (a[i][j]<t) {t=a[i][j];m=i;}
         }
         c[m][j]=t;
     }
     for (i=0;i<5;i++)
     for (j=0;j<5;j++)
     {
         if (a[i][j]==b[i][j]&&b[i][j]==c[i][j])
         {printf ("%d %d %d\n",i+1,j+1,b[i][j]);
         count++;}

     }
     if (count==0) {printf("not found\n");}
}
/*
?? 
?????? (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;

}
int main()
{
          int i,j,h,x,c,a[5][5],b[5];
x=0;
          for(i=0;i<5;i++) scanf("%d %d %d %d %d",&a[i][0],&a[i][1],&a[i][2],&a[i][3],&a[i][4]);
          for(i=0;i<5;i++)
          {
                          for(j=0;j<5;j++)
                          {
                                          b[j]=a[i][j];
                          }
                          for(j=0;j<5;j++)
                          {
                                          for(h=0;h<4;h++)
                                          {
                                                          if(b[h]<=b[h+1])
                                                          {
                                                                         c=b[h];
                                                                         b[h]=b[h+1];
                                                                         b[h+1]=c;
                                                          };
                                          }
                          }
                          for(j=0;j<5;j++)
                          {
                                          if(a[i][j]==b[0])
                                          {
                                                           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]) 
                                                           {
                                                                                                                                                        printf("%d %d %d\n",i+1,j+1,a[i][j]);
                                                                                                                                                        x=100;
                                                           }
                                          }
                          }
          }
          if(x==0) printf("not found");
}
int main()
{
	int a[5][5];
	int i,j,k,col;
	int flag[5];
	int finding;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		finding=a[i][0];
		col=0;
		for(j=1;j<5;j++)
		{
			if(a[i][j]>finding)
			{
				finding=a[i][j];
				col=j;
			}
		}
		flag[i]=1;
		for(k=0;k<5;k++)
		{
			if(a[k][col]<finding)
			{
				flag[i]=0;
				break;
			}
		}
		if(flag[i]==1)
		{
			printf("%d %d %d",i+1,col+1,finding);
		}
	}
	if(flag[0]==0&&flag[1]==0&&flag[2]==0&&flag[3]==0&&flag[4]==0)
		printf("not found");
	
	return 0;
}
int main()
{
int i,j,k,a[N][N],max,maxj,f;
for(i=0;i<N;i++)
   for(j=0;j<N;j++)
      scanf("%d",&a[i][j]);
for(i=0;i<N;i++)
{
  max=a[i][0];
  maxj=0;
  for(j=0;j<N;j++)
    if(a[i][j]>max)
      {
         max=a[i][j];
         maxj=j;
      }
  f=1;
  for(k=0;k<N;k++)
    if(max>a[k][maxj])
        {f=0;continue;}
  if(f){printf("%d %d %d",i+1,maxj+1,a[i][maxj]);break;}
  

}
if(!f) printf("not found");
return 0;

}
int main()
{
	int a[5][5],max[5],mi[5];
	int i,j,k,m,n,x,y;
	k=0;m=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	for(j=0;j<5;j++)
	{
		m=0;
		for(i=0;i<5;i++)
	{
		if(m<a[j][i])
		m=a[j][i];}
		max[j]=m;
	}
	for(j=0;j<5;j++)
	{
		n=a[0][j];
		for(i=0;i<5;i++)
	{
		
		if(n>a[i][j])
		n=a[i][j];}
		mi[j]=n;
	}
	
	
	
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(a[i][j]==max[i]&&a[i][j]==mi[j])
			{
				
			printf("%d %d %d",i+1,j+1,a[i][j]);
			k++;}
		}
	}
	if(k==0)
	printf("not found");
	
	
}
int main()
{
	int i,j,a[6][6],max[6]={0},min[6]={0,100000,100000,100000,100000,100000},sum=0;
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=5;j++)
		{
			cin>>a[i][j];
			if(a[i][j]<min[j])
				min[j]=a[i][j];
			if(a[i][j]>max[i])
				max[i]=a[i][j];
		}
	}
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=5;j++)
		{
			if(a[i][j]==max[i]&&a[i][j]==min[j])
			{
				sum++;
				cout<<endl<<i<<" "<<j<<" "<<a[i][j];
			}
		}
	}
	if(sum==0)
		cout<<"not found";
	return 0;
}
main()
{
    int a[6][6];
    int ok = 1;
    for (int i = 1;i <=5;i ++)
        for (int j = 1;j <= 5;j ++)
            scanf("%d",&a[i][j]);
    for (int i = 1;i <= 5;i ++)
        for (int j = 1;j <= 5;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])
                printf("%d %d %d",i,j,a[i][j]),ok = 0;
    if (ok)
        printf("not found");
}
int main()
{
	int a[5][5],i,j,h,k,q,flag=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>a[i][j];
    for(h=0;h<5;h++)
	{  
		int da=a[h][0],	 n2=0;
	     for(k=0;k<5;k++)  
		 {if(da<a[h][k])  { n2=k; da=a[h][k];}}
            int xiao=a[0][n2],n1=0;
		  for(q=0;q<5;q++)  
		  {	if (xiao>a[q][n2] ) {n1=q; xiao=a[q][n2];}}

		  if(h-n1==0) {
			  cout<<n1+1<<" "<<n2+1<<" "<<a[n1][n2]<<endl; 
			  flag++;
		  }
 }
	if (flag==0)   cout<<"not found";
 return 0;
}
main()
{
      int i,j,m,n,a[5][5],max,min,s=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++)
            {
                    max=a[i][j];
                    for(m=0;m<5;m++)
                    {if(a[i][m]>max)
                     max=a[i][m];}
                    min=a[i][j];
                    for(n=0;n<5;n++)
                    {if(a[n][j]<min)
                     min=a[n][j];}
                     if((a[i][j]==max)&&(a[i][j]==min))
                     printf("%d %d %d\n",i+1,j+1,a[i][j]); 
                     else
                     s++;
                     if(s==25)
                     printf("not found\n");
            }
      }
      getchar();getchar();getchar();getchar();getchar();getchar();
}
int main(){
	int sz[5][5],k,i,n,m;
	n=5;
	for(i=0;i<n;i++){
		for(k=0;k<n;k++){
		scanf("%d",&sz[i][k]);
	}
	}
           m=1;
	for(k=0;k<n;k++){
		for(i=0;i<n;i++){
			if(sz[i][k]>=sz[i][0]&&sz[i][k]>=sz[i][1]&&sz[i][k]>=sz[i][2]&&sz[i][k]>=sz[i][3]&&sz[i][k]>=sz[i][4]){
				if(sz[i][k]<=sz[0][k]&&sz[i][k]<=sz[1][k]&&sz[i][k]<=sz[2][k]&&sz[i][k]<=sz[3][k]&&sz[i][k]<=sz[4][k]){
					printf("%d %d %d",(i+1),(k+1),sz[i][k]);
               m=0;
		}
	}
		}
	}
                 if(m){
                 printf("not found");   
} 
			return 0;
}
//???2010?11?5?
//???1000010586_???
//???????

int main()
{
	int i , j , k , m , p , q , num , ans = 0;       //????
	int a[5][5] , max[5] = {0}, s[5];                //??3???                
	for ( p = 0 ; p <= 4 ; p++ )
	{
		for ( q = 0 ; q <= 4 ; q++ )                 //????
		{
			cin >> a[p][q];
		}
	}
	for ( i = 0 ; i <= 4 ; i++ )                     //????????
	{
		max[i] = a[i][0];
		s[i] = 0;
		for( j = 1 ; j <= 4 ; j++)
		{	
			 if ( a[i][j] >= max[i] )
			 {
				max[i] = a[i][j] ;
				s[i] = j;                            //????
			 }
		} j = 0;
	}
	for ( k = 0 ; k <= 4 ; k++)                      //???????
	{
		num = 0;
		for ( m = 0 ; m <= 4 ; m++ )
		{
			if ( max[k] > a[m][s[k]])
			num = 1;
		}
			if ( num == 0 )
			{ cout << k+1 << " " << s[k]+1  << " " << max[k] << endl;
			ans++;}
		
	}
	if ( ans == 0 )
		cout << "not found" << endl;                 //???????
	return 0;
}
int main()
{
	int num[5][5];
	int i,j;
	int max[5],min[5];
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>num[i][j];
	for(i=0;i<5;i++)
	{
		max[i]=0;
		min[i]=0;
	}
	for(i=0;i<5;i++)
	{
		max[i]=num[i][0];
		for(j=0;j<5;j++)
		{
			if(num[i][j]>max[i])
				max[i]=num[i][j];
		}
	}
	for(j=0;j<5;j++)
	{
		min[j]=num[0][j];
		for(i=0;i<5;i++)
		{
			if(num[i][j]<min[j])
				min[j]=num[i][j];
		}
	}
	int test=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
		{
			if(max[i]==min[j]&&max[i]==num[i][j])
				{
					cout<<i+1<<" "<<j+1<<" "<<num[i][j]<<endl;
					test=1;
				}				
		}
	if(test==0)
		cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int i,j,m,n,t=0,a[5][5],p;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<5;i++)
	{
		m=0;
		for(j=0;j<5;j++)
		{
			if(a[i][m]<=a[i][j])
			{
				m=j;
				p=i;
			}
		}
		n=0;
		for(j=0;j<5;j++)
		{
		    if(a[n][m]>=a[j][m]) n=j;
		}
		if(p==n)
		{
			t++;
			printf("%d %d %d",n+1,m+1,a[n][m]);
		}
	}
	if(t==0) printf("not found");
	return 0;
}
int main()
{
    int a[6][6] = {0}, maxI[6]={0}, JofmaxI[6]={0},
    minJ[6]={0}, n=0;
    int i, j;
    for (i=1;i<=5;i++)
    {
        for (j=1;j<=5;j++)
        {
            cin >> a[i][j];
            if (a[i][j]>maxI[i])
            {
                maxI[i]=a[i][j];
                JofmaxI[i]=j;
            }
        }
    }
    for (j=1;j<=5;j++)
    {
        minJ[j]=a[1][j];
        for (i=2;i<=5;i++)
        {
            if (a[i][j]<minJ[j])
            {
                minJ[j]=a[i][j];
            }
        }
    }
    for (i=1;i<=5;i++)
    {
        if (maxI[i]==minJ[JofmaxI[i]])
        {
            cout << i << " " <<JofmaxI[i]<<" "<<maxI[i]<<endl;
            n++;
        }
    }
    if (n==0) cout << "not found";
    return 0;
}
int main()
{
    int a[10][10],b=0; //?????i<5,j<5,a[i+1][j],a[i+2][j],a[i+3][j],a[i+4][j],a[i][j+1],a[i][j+2],a[i][j+3],a[i][j+4]?? 
    for(int i=0;i<5;i++)
    {
      for(int j=0;j<5;j++)
      cin>> a[i][j];
    }
    for(int i=0;i<5;i++)
    {
      for(int j=5;j<10;j++)
      a[i][j]=a[i][j-5];
    }
    for(int i=0;i<5;i++)
    {
      for(int j=5;j<10;j++)
      a[j][i]=a[j-5][i];
    }
    for(int i=0;i<5;i++)
    {
      for(int j=0;j<5;j++)
      {
        if((a[i][j]>a[i][j+1])&&(a[i][j]>a[i][j+2])&&(a[i][j]>a[i][j+3])&&(a[i][j]>a[i][j+4])
         &&(a[i][j]<a[i+1][j])&&(a[i][j]<a[i+2][j])&&(a[i][j]<a[i+3][j])&&(a[i][j]<a[i+4][j]))//????????? 
        {
          b=1;
          cout<< i+1 << " " << j+1 << " " << a[i][j] <<endl;
        }
      }
    }
    if(b==0)
    cout<< "not found" <<endl;
    return 0;
}
int main()
{
    int hang[6][6],lie[6][6],a[6][6];
    int i , j ,k ,hmax= -1000000,lmin= 1000000;
    int hangh,hangl,lieh,liel,temp = 0;
    int n = 5;
    memset( hang,0,sizeof(hang) );
    memset( lie,0,sizeof( lie) );
    for( i = 1;i <= n;i++ )
    for( j = 1;j <= n;j++ )
    scanf("%d",&a[i][j]);
    for( i = 1;i <= n;i++ )
    {
         for( j = 1;j <= n;j++ )
        {
         if( a[i][j]>hmax )
        {
          hangh = i;
          hangl = j;
          hmax = a[i][j]; 
        } 
        } 
        hang[hangh][hangl] = 1;
        hmax = -1000000;
    }
     for( i = 1;i <= n;i++ )
    {
     for( j = 1;j <= n;j++ )
    {
          if( a[j][i] <lmin ) 
          {
             lieh = j;
             liel = i;
             lmin = a[j][i];
          }
    }
    lie[lieh][liel] = 1;
    lmin = 1000000;
    }
    for( i = 1;i <= 5;i++ )
    for( j = 1;j <= 5;j++)
    {
    if(hang[i][j]==1 &&lie[i][j] == 1)
    {printf("%d %d %d\n",i,j,a[i][j]);
    temp ++;} 
    }
    if(temp == 0)
    printf("not found");
}
int main(){
int a[5][5],b[5],c[5];
int q,w;
for(q=0;q<5;q++){
	for(w=0;w<5;w++){
	scanf("%d",&a[q][w]);
	}
	b[q]=a[q][0];
}
int e,r;
for(e=0;e<5;e++){
	for(r=0;r<5;r++){
		if(b[e]<=a[e][r]){b[e]=a[e][r];}
		else{b[e]=b[e];}
	}
}
int t,y,i=0;
for(t=0;t<5;t++){
	for(y=0;y<5;y++){
		if(a[t][y]==b[t]){c[t]=y;break;
		}
	}
}
int u,p,s=0;
for(u=0;u<5;u++){
	for(p=0;p<5;p++){
		if(b[u]<a[p][c[u]]){s+=1;}
		else{s+=0;}
	}
	if(s==4){printf("%d %d %d",u+1,c[u]+1,b[u]);i+=1;}
	else {i=i;}
	s=0;
}
if(i==0){printf("not found");}
return 0;
}
/*        ????
??:???        2010.11.03    */
int main()
{
	int a[25], row[25], line[25];//row????line???
	int i, s, t, j;
	for(i = 0; i < 25; i++)
	{
		cin >> a[i];
		row[i] = i / 5 + 1;
		line[i] = i % 5 + 1;//?????
	}
	s = 0;//???????
	for(i = 0; i < 25; i++)
	{
		t = 0;//??a[i]?????
		for(j = 0; j < 25; j++)
		{
			if(row[j] == row[i])
				if(a[j] > a[i])
					t = 1;
			if(line[j] == line[i])
				if(a[j] < a[i])
					t = 1;
		}
		if(t == 0)
		{
			cout << row[i] << " " << line[i];
			cout << " " << a[i] << endl;
			s = 1;
		}
	}
	if(s == 0)
		cout << "not found" << endl;
	return 0;
}
int main(){
int a[5][5],i,j,max[5],min[5],k=0;
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]){
            if(max[i]==a[i][j]){
            printf("%d %d %d",i+1,j+1,a[i][j]);
             k++;
            }
            }
        }
    }
 if(k==0){
        printf("not found");
}
 return 0;
}
int main() 
{ 
    int a[5][5] ; 
    int flag = 0 ; 
    int b , c , d , e , f=0 , g ; 
    for(int i = 0 ;i < 5 ; i++) 
    { 
         for(int k = 0 ;k < 5 ;k++) 
         { 
              cin>>a[i][k] ; 
         } 
    } 

    for(int i = 0 ; i < 5 ; i++ ) 
    { 
         b = a[i][0] ; 
         c = 0 ; 
         for(int j = 0 ; j < 5 ; j++ ) 
         { 
              if(a[i][j] >= b) 
              { 
                   b = a[i][j] ; 
                   c = j ; 
                   f = i ; 
              } 
         } 
         if((b<=a[1][c])&&(b<=a[2][c])&&(b<=a[3][c])&&(b<=a[4][c])&&(b<=a[0][c])) 
         { 
              flag = 1 ; 
              d = b ; 
              e = c + 1; 
              g = f + 1; 
              break ; 
         } 
    } 
    if(flag == 1) 
         cout<<g<<" "<<e<<" "<<d ; 
    else 
         cout<<"not found"; 
    return 0 ; 
}
int main()
{
    int matrix[5][5], i, j, k, m, s, t, n = 0;
    
    for(i = 0; i < 5; i++)
    {
        for(j = 0; j < 5; j++)
        cin >> matrix[i][j];
    }
    
    for(i = 0; i < 5; i++)
    {
        s = i;
        t = 0;
        m = matrix[i][0];
        
        for(j = 0; j < 5; j++)
        {
            if(m < matrix[i][j])
            {
                m = matrix[i][j];
                t = j;
            }
        }
        
        j = 0;
        
        for(k = 0; k < 5; k++)
        {
            if(m > matrix[k][t]) j++;
        }

        if(j == 0)
        {
            cout << s + 1 << " " << t + 1 << " " << m << endl;
            n++;
        }
    }
    
    if(n == 0) cout << "not found" << endl;

    return 0;
}
/*************************
 ***??:??? 1200012776
 ***????:????
 ***??:2012?11?5?
 *************************/
int main()
{
	int matrix[6][6], point[6][6] = {0}, i, j, k, min, max, max_row = 0, min_col = 0, point_ok = 0;
	for (i = 1; i <= 5; i++)
	{
		for (j = 1; j <= 5; j++)
		{
			cin >> matrix[i][j];	//????
		}
	}
	for (i = 1; i <= 5; i++)	//??????????
	{
		max = matrix[i][1];	//?max???
		max_row = 1;
		for (j = 2; j <= 5; j++)
		{
			if (matrix[i][j] > max)	//?????????????????
			{
				max_row = j;	//???????????
				max = matrix[i][j];	//????????
			}
		}
		point[i][max_row]++;	//?point???????i,max_row?????,????????"????"??
	}
	for (j = 1; j <= 5; j++)	//??????????,??
	{
		min = matrix[1][j];
		min_col = 1;
		for (i = 2; i <= 5; i++)
		{
			if (matrix[i][j] < min)
			{
				min_col = i;
				min = matrix[i][j];
			}
		}
		point[min_col][j]++;
	}
	for (i = 1; i <= 5; i++)
	{
		for (j = 1; j <= 5; j++)	//????????point
		{
			if (point[i][j] == 2)	//??????2????????????
			{
				cout << i << " " << j << " " << matrix[i][j] << endl;
				point_ok++;	//????
			}
		}
	}
	if (!point_ok)	//?????
	{
		cout << "not found" << endl;
	}
	return 0;
}
int main()
{
    int a[5][5],k,m=0,n,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++)
    {
        n=0;
        for(k=0;k<5;k++)
        {
            if(a[k][j]>=a[i][j]&&a[i][k]<=a[i][j])
                 n=n+1;
                       }
        if(n==5) cout<<i+1<<" "<<j+1<<" "<<a[i][j];
       else m=m+1;
    }
    }
        if(m==25) cout<<"not found";
        return 0;
        }
int main()
{
	int x[5][5],max[5],min[5],i,j,t,k=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&x[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		t=0;
		for(j=0;j<5;j++)
		{
			if(x[i][j]>t)
				t=x[i][j];
		}
		max[i]=t;
	}
	for(i=0;i<5;i++)
	{
		t=x[0][i];
		for(j=0;j<5;j++)
		{
			if(x[j][i]<t)
				t=x[j][i];
		}
		min[i]=t;
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(x[i][j]==max[i]&&x[i][j]==min[j])
			{
				k=1;
				printf("%d %d %d",i+1,j+1,x[i][j]);
			}
		}
	}
	if(k==0)
		printf("not found");
	return 0;
}
int main()
{
	int a[5][5];
	int i=0,j=0,k=0,l=0,min,max,s=0;
	int b[5],c[5];
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
			cin>>a[i][j];
	}
	for(i=0,k=0,j=0;i<5,k<5;i++,k++,j=0)
	{	
		max=a[i][j];
		b[k]=0;
		for(j=0;j<5;j++)
		{
		
			if (a[i][j]>=max)
			{
				max=a[i][j];
				b[k]=j;
			}
		}
	}
	for(j=0,l=0,i=0;j<5,l<5;j++,l++,i=0)
	{
	    min=a[i][j];
		c[l]=0;
		for(i=0;i<5;i++)
		{
			if(a[i][j]<=min)
			{
				min=a[i][j];
			    c[l]=i;
			}
		}
		
	}
	for(l=0;l<5;l++)
	{
		for(k=0;k<5;k++)
		{
			if(l==b[k])
			{
				if(k==c[l])
				{
					cout<<k+1<<" "<<l+1<<" "<<a[k][l]<<endl;
					s=1;
				}
			}
		}

	}
	if(s==0)
		cout<<"not found"<<endl;
	return 0;
}
//****************************************
//*???????                            **
//*????? 1100013004                     **
//*???2010.10.28                          **
//****************************************
int main() 
{  
    int a[6][6] = {0},l[6] = {0},h[6] = {0},i,j,flag = 1;//*l[6],h[6]??????????? ** 
    for(i = 0;i < 5;i++) 
       for(j = 0; j < 5;j++)
          cin>>a[i][j];
    for(i = 0;i < 5;i++)
       {
           l[i] = 0;
           for (int j=0;j<5;j++) if (a[i][j]>l[i]) l[i] = a[i][j];
           h[i] = 100000000;
           for (int j=0;j<5;j++) if (a[j][i]<h[i]) h[i] = a[j][i];        
       }
    for(i = 0;i < 5;i++) 
       for(j = 0; j < 5;j++)
       {
             if (a[i][j] == l[i] && a[i][j] == h[j])
             {cout<<i+1<<' '<<j+1<<' '<<a[i][j]<<endl;
             flag = 0;}
       }
    if(flag)
       cout<< "not found"<<endl;

    return 0;
}
int main()
{int a[5][5];
int max,i,j,bo=1,get=0,k,r;
for(i=0;i<5;i++)
	for(j=0;j<5;j++)
		cin>>a[i][j];
for(i=0;i<5;i++){
	max=a[i][0];
	r=0;
	bo=1,get=0;
	for(j=1;j<5;j++)
		if(a[i][j]>max)
            {max=a[i][j];
            r=j;
            }

	for(k=0;k<5;k++)
		if(a[k][r]<max)
			bo=0;
	if(bo)
	{
		cout<<i+1<<" "<<r+1<<" "<<max<<endl;/*??????????????????????????????????*/
		get=1;
		break;
	}
         }
	if(!get)
		cout<<"not found"<<endl;/*?????????????????????????????"not found"*/
return 0;
}