semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int m,n,i,j,a[22][22],x,y;
    scanf("%d %d",&m,&n);
    for(i=1;i<=m;i++){
    for(j=1;j<=n;j++)
    {scanf("%d",&a[i][j]);}}
    for(i=0;i<22;i++)
    {a[0][i]=0;
    a[m+1][i]=0;
    a[i][0]=0;
    a[i][n+1]=0;}
    for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
    if(a[i][j]>=a[i-1][j]&&a[i][j]>=a[i][j-1]&&a[i][j]>=a[i+1][j]&&a[i][j]>=a[i][j+1])
    {x=i-1;y=j-1;
    printf("%d %d\n",x,y);}}}

    return 0;
}
int main()
{
    int i=0,j=0,m=0,n=0,x=0;
    int b[400],c[400];
    int a[20][20];
    scanf("%d%d",&m,&n);
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
    for(i=0;i<m;i++)
    {
        for(j=0;j<n;j++)
        {
            if(i==0&&j==0)
            {
                if(a[0][0]>=a[0][1]&&a[0][0]>=a[1][0])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(i==0&&j==n-1)
            {
                if(a[0][n-1]>=a[0][n-2]&&a[0][n-1]>=a[1][n-1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(i==0&&j!=0&&j!=n-1)
            {
                if(a[0][j]>=a[0][j-1]&&a[0][j]>=a[0][j+1]&&a[0][j]>=a[1][j])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(j==0&&i!=0&&i!=m-1)
            {
                if(a[i][0]>=a[i-1][0]&&a[i][0]>=a[i+1][0]&&a[i][0]>=a[i][1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(j==0&&i==m-1)
            {
                if(a[m-1][0]>=a[m-2][0]&&a[m-1][0]>=a[m-1][1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(i==m-1&&j!=0&&j!=n-1)
            {
                if(a[i][j]>=a[i-1][j]&&a[i][j]>=a[i][j-1]&&a[i][j]>=a[i][j+1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(i==m-1&&j==n-1)
            {
                if(a[i][j]>=a[i][j-1]&&a[i][j]>=a[i-1][j])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(j==n-1&&i!=0&&i!=m-1)
            {
                if(a[i][j]>=a[i-1][j]&&a[i][j]>=a[i+1][j]&&a[i][j]>=a[i][j-1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
            if(i!=0&&j!=0&&i!=m-1&&j!=n-1)
            {
                if(a[i][j]>=a[i-1][j]&&a[i][j]>=a[i+1][j]&&a[i][j]>=a[i][j-1]&&a[i][j]>=a[i][j+1])
                {
                    b[x]=i;
                    c[x]=j;
                    x++;
                }
            }
        }
    }
    for(i=0;i<x;i++)
    {
        printf("%d %d",b[i],c[i]);
        if(i!=x-1)
        {
            printf("\n");
        }
    }
    return 0;
}
int main()
{
    char comp(int point,int up,int down, int left,int right);
	int a[22][22],j,k,m,n;
    scanf("%d%d",&m,&n);
    for(j=0;j<m+2; ++j)
	{a[j][0]=-1; a[j][n+1]=-1;} 
    for(k=1;k<n+1; ++k)
	{a[0][k]=-1; a[m+1][k]=-1;} 
    for(j=1;j<m+1; ++j)
       for(k=1;k<n+1;++k)
          scanf("%d",&a[j][k]); 
    for(j=1;j<m+1; ++j)
       for(k=1;k<n+1;++k)
          if(comp(a[j][k],a[j-1][k],a[j+1][k],a[j][k-1],a[j][k+1]))
             printf("%d %d\n",j-1,k-1);
	return 0;
}

char comp(int point, int up, int down, int left, int right)
{
return ((point>=up)&&(point>=down)&&(point>=left)&&(point>=right));
}
int main()
{
	int n,i,j,sign,sg,max;
	int a[10][10];
	int maxline[10];

	for (i=1;i<=5;i++)
		for (j=1;j<=5;j++)
			scanf("%d",&a[i][j]);
	for (i=1;i<=5;i++)
	{
		max=1;
		for (j=2;j<=5;j++)
			if (a[i][j]>a[i][max]) max=j;
		maxline[i]=max;
	}
	sg=0;
	for (i=1;i<=5;i++)
	{
		sign=1;
		for (j=1;j<=5;j++)
			if (a[j][maxline[i]]<a[i][maxline[i]]) sign=0;
		if (sign==1) {printf("%d %d %d",i,maxline[i],a[i][maxline[i]]);sg=1;}
	}
	if (sg==0) printf("not found");
	return 0;
}
//*******************************************************************
//????
int main ()//???
{
	int a[6][6],i,j,k,t=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++)
			{
				t=0;//???
				for(k=0;k<5;k++)//????
				{
					if(a[i][j]>a[i][k])
						t++;
					if(a[i][j]<a[k][j])
						t++;						 
			    }
				if(t==8)//??
				{
					cout<<i+1<<" "<<j+1<<" "<<a[i][j];
	                j=5;
					i=5;//????
				}
				else if(i==4&&j==4)//???
					cout<<"not found";
		   }
		return 0;//?????
}
int main()
{
        int ju[10][10],i,j,d=0,k,e=0,f=0;
        for(i=0;i<5;i++)
                 for(j=0;j<5;j++)
                 cin>>ju[i][j];
        for(i=0;i<5;i++)
        {
                        
                        for(j=0;j<5;j++)
                        {d=0;
                                        for(k=0;k<5;k++)
                                        {     
                                                        if(ju[i][j]>ju[i][k])
                                                        {
                                                                             d++;
                                                        }
                                        }
                                        if(d==4)  break;
                        }e=0;
                        for(k=0;k<5;k++)
                        {
                                        if(ju[i][j]<ju[k][j])
                                        e++;
                        }
                        if(e==4) {cout<<i+1<<' '<<j+1<<' '<<ju[i][j]<<endl;f++;}
        }
        if(f==0)   cout<<"not found";
        
             
return 0;
}
int main()
{
	int a[6][6];//??????a[6][6]
	int i,j,t=0;//??????i,j,????t
	int max[6],min[6],row[6]={1,1,1,1,1,1},colum[6]={1,1,1,1,1,1};//????????max[6],??????min[6]???row,??colum
	for(i=1;i<=5;i++)//?????a[6][6]
	{
		for(j=1;j<=5;j++)
		{
			cin>>a[i][j];
			max[i]=a[i][1];//????????a[i][1]
			min[j]=a[1][j];//????????a[1][j]
		}
	}
	for(i=1;i<=5;i++)//????????5?????
	{
		for(j=2;j<=5;j++)
		{
			if(a[i][j]>max[i])
			{
				max[i]=a[i][j];//??i??????max[i]
				colum[i]=j;//??i???????????colum[i]
			}
		}
	}
	for(j=1;j<=5;j++)//????
	{
		for(i=2;i<=5;i++)
		{
			if(a[i][j]<min[j])
			{
				min[j]=a[i][j];
				row[j]=i;
			}
		}
	}
	for(i=1;i<=5;i++)//?????5?????5????????
	{
		for(j=1;j<=5;j++)
		{
			if(max[i]==min[j])//??i???????j????
			{
				cout<<row[j]<<' '<<colum[i]<<' '<<max[i]<<endl;//???row[j]?colum[i]?????
				t=t+1;//t?1
				break;//????
			}
		}
	}
	if(t==0)//?t=0
		cout<<"not found"<<endl;//??not found
	return 0;
}
//***************************
//?????????        *
//?    ?????	        *
//?    ??2010.11.06      *
//?    ??1000012856	    *
//***************************
int main()
{
	//????i???,j?,hang????????lie????num???????h????????l?????
	int i, j, h[5], l[5], hang = 0, lie, num;
	int a[5][5];
	for(i = 0; i < 5; i++)
	{
		for(j = 0; j < 5; j++)
			cin >> a[i][j];						//????
	}
	for(i = 0; i < 5; i++)
	{
		h[i] = a[i][0];							//???????????????
		for(j = 0; j < 5; j++)
		{
			if(a[i][j] > h[i])
				h[i] = a[i][j];					//??????h?????
		}
	}
	for(j = 0; j < 5; j++)
		{
			l[j] = a[0][j];
			for(i = 0; i < 5; i++)
			{
				if(a[i][j] < l[j])
					l[j] = a[i][j];				//???l
			}
		}
	for(i = 0; i < 5; i++)
	{
		for(j = 0; j < 5; j++)					//??????
		{
			//??????????????????
			if((a[i][j] == h[i]) && (a[i][j] == l[j]))
			{
				hang = i + 1;					//hang?i??,??hang????0
				lie = j + 1;					//lie?j??
				num = a[i][j];					//???a[i][j]
			}
		}
	}
	if(hang == 0)								//??hang??0????????????
		cout << "not found" << endl;			//?????
	else 
		//??????
		cout << hang << " " << lie << " " << num << endl; 
	
	return 0;
}
main()
{
      int i,j,k,m;
      int p[5][5];
      for(i=0;i<=4;i++)
      {
                       for(j=0;j<=4;j++)
                       scanf("%d",&p[i][j]);
      }
      for(i=0;i<=4;i++)
      {
                       k=0;
                       m=0;
                       for(j=0;j<=3;j++)
                       if(p[i][k]<p[i][j+1]) k=j+1;
                       for(j=0;j<=3;j++)
                       if(p[m][k]>p[j+1][k]) m=j+1;
                       if(m==i) break;
      }
      if(i==5) printf("not found");
      else printf("%d %d %d",m+1,k+1,p[m][k]);
}
main()
{
    int a[6][6],i,j,k,l,m=5,n=5,c=0,g=0;
    for (i=0;i<m;i++)
    {
        for (j=0;j<n;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
    for (l=0,i=0;i<m;i++)
    {
        for (j=0;j<n;j++)
        {
            if (a[i][j]>l)
            {
                l=a[i][j];
                c=j;
            }
        }
        for (k=0;k<m;k++)
        {
            if (a[k][c]<l)
            {
                l=a[k][c];
                break;
            }
        }
        if (l==a[i][c])
        {
            printf ("%d %d %d\n",i+1,c+1,a[i][c]);
            g=-1;
        }
        l=a[i+1][0];
        c=0;
    }
    if(g==0)
    printf("not found\n");
}
int max(int x,int y)
{
    if(x>=y)
    return x;
    else
    return y;
}

main()
{
      int a[5][5],b[5][5],i,j,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++)
      {
                      for(j=0;j<5;j++)
                      b[i][j]=0;
      }
      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])
                                      b[i][j]++;
                      }
      }
      for(i=0;i<5;i++)
      {
                      for(j=0;j<5;j++)
                      {
                                      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])
                                      b[i][j]++;
                      }
      }
      for(i=0;i<5;i++)
      {
                      for(j=0;j<5;j++)
                      {
                                      if(b[i][j]==2)
                                      {
                                                    printf("%d %d %d\n",i+1,j+1,a[i][j]);
                                                    k=1;
                                      }
                      }
      }
      if(k==0)
      printf("not found\n");
}
int main()
{
    int sz[ROW][COL];
    int i,row,col,max,min,nmax,nmin,num=0;
    for(row=0;row<ROW;row++){
		for(col=0;col<COL;col++){
			scanf("%d",&sz[row][col]);
			}
		}
	for(row=0;row<ROW;row++){
		for(col=0;col<COL;col++){
			if(col==0){
				max=sz[row][col];
				nmax=0;
				}
			else{
				if(sz[row][col]>max){
					max=sz[row][col];
					nmax=col;
					}
				}
			}
		for(i=0;i<ROW;i++){
			if(i==0){
				min=sz[i][nmax];
				nmin=0;
				}
			else{
				if(sz[i][nmax]<min){
					min=sz[i][nmax];
					nmin=i;
					}
				}
			}
		if(max==min){
			printf("%d %d %d",nmin+1,nmax+1,sz[nmin][nmax]);
			num=num+1;
			}
		}
	if(num==0) printf("not found");
    
    return 0;
}
int main()
{
	int a[5][5],i,j,k,max,x;
	for(i=0;i<5;i++)
	for(j=0;j<5;j++)
	{
		scanf("%d",&a[i][j]);
	}
	for(i=0;i<5;i++)
	{
		for(x=0,max=a[i][0],j=1;j<5;j++)
			if(max<a[i][j])
			{
				max=a[i][j];
				x=j;
			}
		for(j=0;j<5;j++)if(max>a[j][x])break;
		if(j==5)
		{
			printf("%d %d %d",i+1,x+1,max);break;
		}
	}
	if(i==5&&j!=5)printf("not found");
	return 0;
}
int main()
{
	int a[5][5] , i, j, k, 
		max, row, column, count = 0;
	for(i = 0; i < 5; i ++)
	{
		for(j = 0; j < 5; j ++)
		{cin >> a[i][j];}
	}
	for(i = 0; i < 5; i++)
	{
		max = 0;
		for(j = 0; j < 5; j ++)
		{
			if(max < a[i][j])
			{
				max = a[i][j];
				row = i; column = j;
			}
		}
		for(k = 0; k < 5; k ++)
		{
			if(max > a[k][column])
				break;
		}
		if(k == 5)
		{
			count = 1;
			cout << row + 1 << " " << column + 1 
				 << " " << max << endl;
		}
	}
		if(count == 0)
			cout << "not found" <<endl;
	return 0;
}
int main ()
{
	int i, j, k, m, row1, row2, column, max, min, flag = 0;
	int a[5][5];
	for(i = 0; i < 5; i++)
		for(j = 0; j < 5; j++)
		{
			cin >> m;
			a[i][j] = m;
		}
	for(i = 0; i < 5; i++)
	{
		max = 0;
		for(j = 0; j < 5; j++)
		{
			if(a[i][j] > max) 
			{
				max = a[i][j];
				row1 = i;
				column = j;
			}
		}
		min = a[0][column];
		for(k = 0; k < 5; k++)
		{
			if(a[k][column] <= min) 
			{
				min = a[k][column];
				row2 = k;
			}
		}
		if(row1 == row2)
		{
			flag = 1;
			cout << row1 + 1 << " " << column + 1 << " " << max << endl;
		}
		
	}
	if(flag == 0)
		cout << "not found" << endl;
	return 0;
}
int main()
{
 int a[5][5];
 int i , j , x , l , n , max ;
 for ( i=0;i<=4;i++ )
  {
    for ( j=0;j<=4;j++ )
     {
       cin>>x;
       a[i][j]=x;
     }
   }
 l=0;
 for ( i=0;i<=4;i++)
  {
   max=a[i][0];
   n=0;
   for ( j=1;j<=4;j++ )
    {
      if (a[i][j]>a[i][n])
       {
        n=j;
       }
     }
   if ((a[i][n]<=a[0][n])&&(a[i][n]<=a[1][n])&&(a[i][n]<=a[2][n])&&(a[i][n]<=a[3][n])&&(a[i][n]<=a[4][n]))
   {
    cout<<i+1<<" "<<n+1<<" "<<a[i][n]<<endl;
    l++;
   }
  }
 if (l==0)
  {
   cout<<"not found"<<endl;
  }
 return 0;
}
/*
 * findpoint.cpp
 * ????
 *  Created on: 2012-11-18
 *      Author: ???
 */
int max(int x, int y) {
	if (x >= y)
		return x;
	else
		return y;
}
int min(int x, int y) {
	if (x <= y)
		return x;
	else
		return y;
}
int main() {
	int i, k, a[6][6], Y = 0, max1[6], min1[6];
	for (i = 1; i <= 5; i++) {
		for (k = 1; k <= 5; k++) {
			cin >> a[i][k];
		}
	}
	for (i = 1; i <= 5; i++) {
		max1[i] = max(a[i][1],
				max(a[i][2], max(a[i][3], max(a[i][4], a[i][5]))));
	}
	for (k = 1; k <= 5; k++) {
		min1[k] = min(a[1][k],
				min(a[2][k], min(a[3][k], min(a[4][k], a[5][k]))));
	}
	for (i = 1; i <= 5; i++) {
		for (k = 1; k <= 5; k++) {
			if (max1[i] == min1[k]) {
				Y = 1;
				cout << i << ' ' << k << ' ' << a[i][k] << endl;
			}
		}
	}
	if (Y == 0)
		cout << "not found";
	return 0;
}
int main()
{
int a[5][5];
	int max = 0, i, j, flag = 1, tag = 1;
	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][max])
				max = j;
		for ( int k = 0; k < 5; k++) 
			if (a[i][max] > a[k][max])
				flag = 0;
		if (flag)
		{
			cout << i + 1 <<" " << max + 1 << " " << a[i][max];
			tag = 0;
		}
		max = 0;
		flag = 1;
	}
	if (tag)
		cout << "not found";
return 0;
}
int main()
{
	int i,k;//???? i???k??
	int x,y;
	int r=0,c=0;//???? ??????
	int a[5][5];//??
	int w=0;//?? 
	                                     
	for(r=0;r<5;r++)                          
	{
		for(c=0;c<5;c++)
		{
			scanf("%d",&a[r][c]);
		}

	}                                                                        
	for(i=0;i<5;i++)
	{
		for(k=0;k<5;k++)
		{
			if(a[i][k]>=a[i][1]&&a[i][k]>=a[i][2]&&a[i][k]>=a[i][3]&&a[i][k]>=a[i][4]&&a[i][k]>=a[i][0])
			{
				if(a[i][k]<=a[0][k]&&a[i][k]<=a[1][k]&&a[i][k]<=a[2][k]&&a[i][k]<=a[3][k]&&a[i][k]<=a[4][k])
				{
					x=i+1;
					y=k+1;
					printf("%d %d %d\n",x,y,a[i][k]);

					w=1;
				}
			}                                  
		}
	}
	if(w==0)
	{
		printf("not found");
	}

	return 0;
}
int main()
{
    int i,j,k,l,m,n,y,z,a[5][5],d;
    d=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++)
                    {
                                    for(k=0;k<5;k++)
                                    {
                                                    if(j!=k&&a[i][j]<=a[i][k]) break;
                                    }
                                    if(k==5)
                                    {
                                            for(k=0;k<5;k++)
                                            {
                                                            if(i!=k&&a[i][j]>=a[k][j]) break;
                                            }
                                            if(k==5)
                                            {
                                                    printf("%d %d %d",i+1,j+1,a[i][j]);
                                                    d++;
                                            }
                                    }
                    }
    }
    if(d==0) printf("not found");

}
/*
 * a.cpp
 *
 *  Created on: 2010-11-13
 *      Author: Administrator
 */
int main(){
	int a[5][5],i,j,k,n,flag,m=1;
	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++){
			flag=1;
			for(k=0;k<5;k++){
				if(a[i][j]>a[i][k]||k==j)
					continue;
				else{
					flag=0;break;
				}
			}
			if(flag){
				for(n=0;n<5;n++){
					if(a[i][j]>=a[n][j]&&n!=i){
						flag=0;break;
					}
				}
				if(flag) {cout<<i+1<<" "<<j+1<<" "<<a[i][j]<<endl;m=0;}
			}
		}
	if(m) cout<<"not found"<<endl;
	return 0;
}
int main()
{
    int num[5][5],i,j,k[5],h[5],a[5],b[5],m,p,q,x,y;
    for(i=0;i<=4;i++)
      {
                     k[i]=0;
                     for(j=0;j<=4;j++)
                     {
                                      scanf("%d",&num[i][j]);
                                      if (num[i][j]>k[i]) 
                                      {
                                                          k[i]=num[i][j];
                                                          a[i]=j;
                                      }
                     }
                     
      }
      
      
      
      
      for(q=0;q<=4;q++)
      {
                     h[q]=100000;
                     for(p=0;p<=4;p++)
                     {
                                      if (num[p][q]<h[q]) 
                                      {
                                                          h[q]=num[p][q];
                                                          b[p]=p;
                                      }
                     }
                     
      }
      m=0;
      for(x=0;x<=4;x++)
      {
                     for(y=0;y<=4;y++)
                     {
                                      if (k[x]==h[y]) 
                                      {
                                                      printf("%d %d %d\n",x+1,y+1,k[x]);
                                                      m=1;
                                      }
                     }
                     
      }
      
      if(m==0)printf("not found");               
      
}
int rowmax(int a[5])
{
    int t=a[0];
    for(int i=1;i<5;i++)
    {
        if(t<a[i])
           t=a[i];
    }
    return t;
}
int linemin(int a1,int a2,int a3,int a4,int a5)
{
    if(a1>a2)
        a1=a2;
    if(a1>a3)
        a1=a3;
    if(a1>a4)
       a1=a4;
    if(a1>a5)
       a1=a5;
    return a1;
}
main()
{
    int a[5][5],count=0;
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
    for(int i=0;i<5;i++)
    {
        for(int j=0;j<5;j++)
        {
            if(a[i][j]==rowmax(a[i])&&a[i][j]==linemin(a[0][j],a[1][j],a[2][j],a[3][j],a[4][j]))
            {
                printf("%d %d %d\n",i+1,j+1,a[i][j]);
                count++;
            }
        }
    }
    if(count==0)
       printf("not found\n");
}
int a[5][5];
int max(int i,int j)
{
    int s=0;
    for (int k=0;k<5;k++)
    {
        if (a[i][j]>=a[i][k])
        s++;
    }
    if (s==5) return 1;
    else return 0;
}
int min(int i,int j)
{
    int s=0;
    for (int k=0;k<5;k++)
    {
        if (a[i][j]<=a[k][j])
        s++;
    }
    if (s==5) return 1;
    else return 0;
}
main()
{
      for (int i=0;i<5;i++)
      for (int j=0;j<5;j++)
      scanf("%d",&a[i][j]);
      int s=0,I,J;
      for (int i=0;i<5;i++)
      for (int j=0;j<5;j++)
      if (max(i,j)==1 && min(i,j)==1)
      {s=a[i][j];I=i;J=j;}
      if (s!=0)
      printf("%d %d %d\n",I+1,J+1,s);
      else printf("not found\n");
}
int main()
{
	int a[6][6], i, j, min, max, k, m, n, x, y, flag = 0;
	for (i = 1; i < 6; i++)
		for(j = 1; j < 6; j++)
			cin >> a[i][j];
	for (k = 1; k < 6; k++)
	{
		max = 0;
		for (m = 1; m < 6; m++)
		{
			if (max < a[k][m])
			{
				max = a[k][m];
				x = m;
			}
		}
		min = 100000;
		for (n = 1; n < 6; n++)
		{
			if (min >= a[n][x])
			{
				min = a[n][x];
				y = n;
			}
		}
		if (k == y)
		{
			flag = 1;
		    cout << y << ' ' << x << ' ' << a[y][x] << endl;
		}
	}
	if (flag == 0)
		cout << "not found";
	return 0;
}
int main()
{
	int i,j,a[5][5];
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>a[i][j];
	int max,count=0,maxj;
	for(i=0;i<5;i++)
	{
		int flag=1;
		max=a[i][0];
		maxj=0;                //?????????
		for(j=1;j<5;j++)
			if(a[i][j]>max)
			{
				max=a[i][j];
				maxj=j;
			}
			for(j=0;j<5;j++)
				if(a[j][maxj]<max)
				{
					flag=0;
					break;
				}
				if(flag==1)
				{
					count++;
					cout<<i+1<<' '<<maxj+1<<' '<<a[i][maxj]<<endl;
					break;
				}
	}
	if(count==0)
		cout<<"not found"<<endl;
	return 0;
}
/******************????************************
??
?????? (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
*********************************************************
????
????????????row[i]
????????????cloumn[j]
??column[row[i]]==i,?????
programmer Qiu Hezi
version 1.0
creat date 2012.10.30 1:13
*********************************************************/
int main()
{
    int a[6][6];
    for (int i=1 ; i<=5 ; i++)
        for (int j=1 ; j<=5 ; j++)
    {
        cin>>a[i][j];
    }

    int max_row[6]={0},min_column[6]={0};
    int line_row[6]={0},line_column[6]={0,1,1,1,1,1};
    //?????????/???????
    for (int j=1 ; j<=5 ; j++)
        min_column[j]=a[1][j];//?????????
    for (int i=1 ; i<=5 ; i++)
        for (int j=1 ; j<=5 ; j++)
    {
        if (a[i][j] > max_row[i])
        {
            max_row[i]=a[i][j];
            line_row[i]=j;
        }
        if (a[i][j] < min_column[j])
        {
            min_column[j]=a[i][j];
            line_column[j]=i;
        }
    }
    int success=0;
    for (int i=1 ; i<=5 ; i++)
        if (line_row[line_column[i]]==i)
        {
            cout<<line_column[i]<<" "<<i<<" "<<a[line_column[i]][i];
            success=1;
        }
    if (success==0)
        cout<<"not found"<<endl;

    return 0;
}
int main()
{
	int a[5][5], max[5], min[5], maxx[5], maxy[5], minx[5], miny[5];
	int i, j, g = 0;

	for (i = 0; i < 5; i++)
	{	
		max[i] = INT_MIN;
		for (j = 0; j < 5; j++)
		{
			cin >> a[i][j];
		    if (max[i] < a[i][j])
			{
			    max[i] = a[i][j];
				maxx[i] = i;
				maxy[i] = j;
			}
		}
    }
	for (j = 0; j < 5; j++)
    {
	    min[j] = INT_MAX;
		for (i = 0; i < 5; i++)
			if (min[j] > a[i][j])
			{
			    min[j] = a[i][j];
				minx[j] = i;
				miny[j] = j;
			}
	}
	for (i = 0; i < 5; i++)
		for (j = 0; j < 5; j++)
			if (maxx[i] == minx[j] && maxy[i] == miny[j])
			{	
				cout << maxx[i] + 1 << " " << maxy[i] + 1<< " " << a[maxx[i]][maxy[i]] << endl;
				g = 1;
			}
	if (g == 0)
		cout << "not found" << endl;
		return 0;
}