semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//***************************
//**???4.cpp
//**??????
//**???2013.11.1
//**?????????
//***************************
int main()
{
	int a[6][6];
	int n = 0, c1, c2;

	for (int i = 1; i <= 5; i++)
		for (int j = 1; j <= 5; j++)
			cin >> a[i][j];
	for (int i = 1; i <= 5; i++)
		for (int j = 1; j <= 5; j++)
		{
			c1 = 0;
			c2 = 0;
			for (int k = 1; k <= 5; k++)
			{
				if (a[i][j] >= a[i][k])
					c1++; // ?c1????????????????????
				if (a[i][j] <= a[k][j])
					c2++; // ?c2????????????????????
			}
			if (c1 == 5 && c2 == 5) // ??????
			{
				cout << i << " " << j << " " << a[i][j];
				n++; // ????
			}				
		}
	if (!n) // ????0?????
		cout << "not found" << endl;
	return 0;	
}
int main()
{
	int a[5][5],b[5][5]={0},c[5][5]={0};
	int i,j,k,num=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 (a[i][j]>=a[i][k])  b[i][j]++;
			if (a[i][j]<=a[k][j])  c[i][j]++;
		}
		if (b[i][j]==5&&c[i][j]==5)
		{
			printf("%d %d %d",i+1,j+1,a[i][j]);
			num++;
		}
	
	}
	if (num==0)  printf("not found");

return 0;
	
	
}
void main()
{
	int a[6][6],i,j,k,p=0,m=0,n=0;
	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++)
		{
			
			for(k=1;k<6;k++)
			{
				if(k==j&&j!=5)
					k++;
				else if(j==5&&k==5)
					break;
				if(a[i][j]>a[i][k])
					p++;
			}
			if(p==4)
			{
				for(k=1;k<6;k++)
				{
					if(k==i)
						k++;
					if(a[i][j]<a[k][j])
						m++;
				}
			    if(m==4)
				{
			     	printf("%d %d %d\n",i,j,a[i][j]);
				    n++;
				}
			}
			p=0;
			m=0;
		}


	if(n==0)
		printf("not found\n");
}
int main()
{
	int a[5][5],b[5][5],v,flag=0;
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{
			cin>>a[i][j];
			b[i][j]=a[i][j];
		}
	}
	for(int i=0;i<5;i++)
	{
		for(int k=0;k<4;k++)
		{
			for(int j=0;j<4-k;j++)
			{
				if(a[i][j]<=a[i][j+1])
				{
					v=a[i][j];
					a[i][j]=a[i][j+1];
					a[i][j+1]=v;
				}
			}
		}
	}
	for(int j=0;j<5;j++)
	{
		for(int k=0;k<4;k++)
		{
			for(int i=0;i<4-k;i++)
			{
				if(b[i][j]>=b[i+1][j])
				{
					v=b[i][j];
					b[i][j]=b[i+1][j];
					b[i+1][j]=v;
				}
			}
		}
	}
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{
			if(a[i][0]==b[0][j])
			{
				cout<<i+1<<' '<<j+1<<' '<<a[i][0];
				flag=1;
			}
		}
	}
	if(flag==0)
	{
		cout<<"not found";
	}
	return 0;
}
int main()
{
	int a[5][5],i,j,m,n,l,k;
	k=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++)
		{
			m=i;n=j;
			l=(a[m][n]>=a[m][0])+(a[m][n]>=a[m][1])+(a[m][n]>=a[m][2])+(a[m][n]>=a[m][3])+(a[m][n]>=a[m][4]);
		    
	     	l=l+(a[m][n]<=a[0][n])+(a[m][n]<=a[1][n])+(a[m][n]<=a[3][n])+(a[m][n]<=a[4][n])+(a[m][n]<=a[2][n]);
		
	    	if(l==10)
			{
		    	cout<<m+1<<' '<<n+1<<' '<<a[m][n];k=0;
			}
		
		}

		
	}
	if(k==1)
		cout<<"not found";
	return 0;
}
int main()
{
	int a[10][10],i,j,t,max,k,l,w=0;
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=5;j++)
		{
			cin>>a[i][j];
		}

	}
	for(i=1;i<=5;i++)
	{
		max=-1;
		l=0;
		for(j=1;j<=5;j++)
		{
			if(a[i][j]>max){t=j;max=a[i][j];}
		}
		for(k=1;k<=5;k++)
		{
			if(a[k][t]<max){l=1;}
		}
		if(l==0){cout<<i<<" "<<t<<" "<<max<<endl;w=1;}
	}
	if(w!=1)cout<<"not found";
	return 0;
}
int main()
{
	int (*p)[5],a[5][5],max,max_y,flag,result=0;
	p=a;
	
	int i,j,k;

	for (i=0;i<5;i++)
		for (j=0;j<5;j++)
			cin>>*(*(p+i)+j);
	
	for (i=0;i<5;i++)
	{
		max=0;
		flag=0;
		for (j=0;j<5;j++)
		{
			if (*(*(p+i)+j)>max)
			{
				max=*(*(p+i)+j);
				max_y=j;
			}
		}
		for (k=0;k<5;k++)
		{
			if (*(*(p+k)+max_y)<*(*(p+i)+max_y))
				flag=1;
		}
		if (flag==0)
		{	
			cout<<i+1<<' '<<max_y+1<<' '<<*(*(p+i)+max_y)<<endl;
			result++;		
		}
	}
	
	if (result==0)
		cout<<"not found";
	
	return 0;
}
int main(){
int ml[5],mh[5];
int w[5][5];
memset(mh,0,sizeof(mh));
memset(ml,0x77777777,sizeof(ml));
for(int i=0;i<N;i++)for(int j=0;j<N;j++){cin>>w[i][j];if(w[i][j]>mh[i])mh[i]=w[i][j];if(w[i][j]<ml[j])ml[j]=w[i][j];}
int b=1;
for(int i=0;i<N;i++)for(int j=0;j<N;j++)if((w[i][j]==mh[i])&&(w[i][j]==ml[j])){b=0;cout<<i+1<<' '<<j+1<<' '<<w[i][j];}
if(b)cout<<"not found";
return 0;
}
//****************************************************** 
//* ? ? ?   ?? ? ? ?                           *
//* ? ?      ?? ? ?                              *
//* ? ? ? ??2010 ? 11 ? 3 ?                    * 
//* ? ?      ?1000010185                            *
//****************************************************** 
int main()
{
	int a[5][5], b[5] = {0}, c[5], flag = 0; //b[i]???i??????c[i]???i????????flag??????
	for (int i = 0; i < 5; i ++)
		for (int j = 0; j < 5; j ++)
		{
			cin >> a[i][j];
			if (a[i][j] > b[i]) //?????????????????????
			{
				b[i] = a[i][j];
				c[i] = j;
			}
		}
	for (int i = 0; i < 5; i ++) //??????????????????
	{
		int j;
		for (j = 0; j < 5; j ++)
			if (a[i][c[i]] > a[j][c[i]])
				break;
		if (j == 5) //?j=5??break?????????
		{
			cout << i + 1 << ' ' << c[i] + 1 << ' ' << a[i][c[i]] << endl;
			flag = 1; //?????????????1
		}
	}
	if (flag == 0) //??????0??????? 
		cout << "not found";
	return 0;
}
int a[6][6];//={0,1,1,1,1,1,0,11,3,5,6,9,0,12,4,7,8,10,0,10,5,6,9,11,0,8,6,4,7,2,0,15,10,11,20,25};
int max(int hang)
{
    int m=0,ji;
    for(int k=1;k<=5;k++)
    {
        if(a[hang][k]>m) {m=a[hang][k]; ji=k;}
    }
    return ji;
}
int min(int lie)
{
    int m=a[1][lie],ji=1;
    for(int k=2;k<=5;k++)
    {
        if(a[k][lie]<m) {m=a[k][lie]; ji=k;}
    }
    return ji;
}

main()
{
      int i,j,x=0;
      for(i=1;i<=5;i++)
      {
          for(j=1;j<=5;j++)
          {
              //printf("%d ",a[i][j]); 
              scanf("%d",&a[i][j]);
          }
          //printf("\n");
      }
      for(i=1;i<=5;i++)
      {
          j=max(i);
          if( min(j)==i ) {printf("%d %d %d\n",i,j,a[i][j]);x=1;}
      }
      if(x==0) printf("not found\n");
}
int main()
{
	int a[5][5],b[5][5],c[5][5],i,k,t,m=0,x,y;
	for(i=0;i<5;i++)
		for(k=0;k<5;k++)
		{
			cin>>a[i][k];
			b[i][k]=a[i][k];
			c[i][k]=a[i][k];
			cout<<endl;
		}
	for(i=0;i<5;i++)
		for(t=0;t<4;t++)
			if(b[i][t]>b[i][t+1])
			{
				k=b[i][t+1];
				b[i][t+1]=b[i][t];
				b[i][t]=k;
			}
	for(t=0;t<5;t++)
		for(i=0;i<4;i++)
			if(c[i][t]<c[i+1][t])
			{
				k=c[i+1][t];
				c[i+1][t]=c[i][t];
				c[i][t]=k;
			}
	for(i=0;i<5;i++)
		for(t=0;t<5;t++)
			if(b[i][4]==c[4][t])
			{
				m++;
				x=i+1;
				y=t+1;
			}
	if(m==0)cout<<"not found";
	else
	cout<<x<<" "<<y<<" "<<b[x-1][4]<<endl;
	return 0;
}
int main()
{
int a[5][5];
int b[5][5]={0};
for(int i=0;i<5;i++)
for(int j=0;j<5;j++)
scanf("%d",&a[i][j]);
int num,max;
for(int j=0;j<5;j++)
{
max=-65535;
for(int i=0;i<5;i++)
if(a[j][i]>max)
{
num=i;
max=a[j][i];
}
b[j][num]=1;
}
int min;
int zhishi=0;
for(int i=0;i<5;i++)
{
min=65535;
for(int j=0;j<5;j++)
if(a[j][i]<min)
{num=j;min=a[j][i];}
if(b[num][i]==1)
{printf("%d %d %d",num+1,i+1,a[num][i]);zhishi=1;}
}
if(!zhishi)
printf("not found");
}
int row_max(int a[][5],int i,int j)
{
	int k,flag=1;

	for(k=0;k<5;k++){
		if(*(*(a+i)+k)>*(*(a+i)+j)){
			flag=0;
			break;
		}
	}

	return flag;
}

int col_min(int a[][5],int i,int j)
{
	int k,flag=1;

	for(k=0;k<5;k++){
		if(*(*(a+k)+j)<*(*(a+i)+j)){
			flag=0;
			break;
		}
	}

	return flag;
}

void main()
{
	int a[5][5];
	int i,j,flag=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++){
			if(row_max(a,i,j)&&col_min(a,i,j)){
				flag=1;
				printf("%d %d %d\n",i+1,j+1,*(*(a+i)+j));
			}
		}
	}

	if(!flag)
		printf("not found\n");
}
//*****************************
//*??? :????           *
//*??   :???             *
//*??   :2011?10?         *
//*****************************
int main ()
{
	int a[5][5],i=0,j=0,max[5]={0},flag=1;
	int q[5]={0},min[5]={1000000,1000000,1000000,1000000,1000000};
	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]>max[i])
			{
				max[i]=a[i][j];
				q[i]=j;
			}
		}
	}
	for(j=0;j<5;j++)
	{
		for(i=0;i<5;i++)
		{
			if(a[i][j]<min[j])
			{
				min[j]=a[i][j];
			}
		}
	}
    for(i=0;i<5;i++)
	{
			if(max[i]==min[q[i]])
			{
			cout << i+1 << " " << q[i]+1 << " " << max[i];
			flag=0;
			}
	}
	
	if(flag==1) cout << "not found";
	return 0;
}
void main()
{
	int a[5][5],i,j,k,b[5][5];
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			b[i][j]=1;
			scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			for(k=0;k<5;k++)
			{
				b[i][j]*=(a[i][j]>=a[i][k]);
				if(b[i][j]==0)
					break;
			}
			if(b[i][j]==0)
				continue;
		}
	}
	for(j=0;j<5;j++)
	{
		for(i=0;i<5;i++)
		{
			for(k=0;k<5;k++)
			{
				b[i][j]*=(a[i][j]<=a[k][j]);
				if(b[i][j]==0)
					break;
			}
			if(b[i][j]==0)
				continue;
		}
	}
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
		{
			if(b[i][j]==1)
			{
				printf("%d %d %d\n",i+1,j+1,a[i][j]);
				return;
			}
		}
	printf("not found\n");
}
int main(){
	int a[6][6]={0};
	int s,t,x,y,q,m,n,i,j,r;
	q=0;
	for (i=1;i<=5;i++){
		for (j=1;j<=5;j++){
		scanf ("%d",&a[i][j]);
		}
	}
	for (r=1;r<6;r++){
	m=a[1][r];
	for (i=1;i<6;i++){
		if (a[i][r]<=m){
		m=a[i][r];
		s=i;
		}
	}
	for (i=s;i<s+1;i++){
	n=a[s][1];
		for (j=1;j<6;j++){
			if (a[s][j]>=n){
			n=a[s][j];
			y=j;
			}
	}
	
		if (y==r) {
		printf ("%d %d %d",s,y,a[s][y]);
		q=1;
		}
	}
	}

	if (q==0)
	{printf ("not found");}
return 0;
}
int main()
{
	int max[6],min[6],row[6],line[6],i,j,a[6][6];
	for (i=1;i<6;i++)
	{
		max[i]=0;
		for (j=1;j<6;j++)
		{
			cin>>a[i][j];
			if (a[i][j]>max[i])
			{
				max[i]=a[i][j];
			    row[i]=i;
				line[i]=j;
			}	
		}
	}
	//for (i=1;i<6;i++)			
	  //cout<<max[i]<<endl;
	for (i=1;i<6;i++)
		{
			min[i]=a[1][i];
			for (j=1;j<6;j++)
			{
				if (min[i]>a[j][i])
				{
					min[i]=a[j][i];
				}
			}
	    }
	//for (i=1;i<6;i++)
			//cout<<min[i]<<endl;
	for (i=1;i<6;i++)
		if (a[row[i]][line[i]]==min[line[i]])
		{
			cout<<row[i]<<' '<<line[i]<<' '<<a[row[i]][line[i]]<<endl;
			return 0;
		}
	cout<<"not found";
	return 0;
}
//***************************************************************
//*?????(11-5) ????                                    *
//*??????                                                 *
//*???1300012888                                             *
//*???2013.11.12                                             *
//***************************************************************

int main()
{
	int num[6][6], i, j, k;

	for (i = 1; i <= 5; i++)
	{
		for (j = 1; j <= 5; j++)
			cin >> num[i][j];
	}
	for (i = 1; i <= 5; i++)
	{
		num[i][0] = INT_MIN;
		for (j = 1; j <= 5; j++)
		{
			if (num[i][j] > num[i][0])
				num[i][0] = num[i][j];
		}
	}
	for (j = 1; j <= 5; j++)
	{
		num[0][j] = INT_MAX;
		for (i = 1; i <= 5; i++)
		{
			if (num[i][j] < num[0][j])
				num[0][j] = num[i][j];
		}
	}
	k = 0;
	for (i = 1; i <= 5; i++)
	{
		for (j = 1; j <= 5; j++)
		{
			if (num[i][j] == num[i][0] && num[i][j] == num[0][j])
			{
				k++;
				cout << i << " " << j << " " << num[i][j] << endl;
			}
		}
	}
	if (k == 0)
		cout << "not found" << endl;

	return 0;
}
int main() {
    int a[m][n],i,j,max,min,flag=0,i1;
       for (i=0;i<m;i++)
        for (j=0;j<n;j++)
            scanf("%d",&a[i][j]);
        for (i=0;i<m;i++) {
        i1=i;
        for (max=a[i][0],j=0;j<n;j++) 
            if (max<a[i][j])
                max=a[i][j];
        for (j=0;j<n;j++) {
            for (min=a[i][j],i=0;i<m;i++)
                if (min>a[i][j])
                    min=a[i][j];
            i=i1;
            if (a[i][j]==max&&a[i][j]==min) {
                printf("%d %d %d",i+1,j+1,a[i][j]);
                flag++;
            }
        }

    }
    if (flag==0)
        printf("not found\n");
    else printf("\n");
}
int main(){
	int map[5][5],max[5],t,i,j,t_max;
	int b=0;
	for(i=0;i<5;i++)
	{
		t_max=0;
		for(j=0;j<5;j++)
		{
			scanf("%d ",&t);
			map[i][j]=t;
			if(t_max<t)
			{
				max[i]=j;
				t_max=t;
			}
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(map[j][max[i]]<map[i][max[i]])
				break;
		}
		if(j==5)
		{
			printf("%d %d %d\n",i+1,max[i]+1,map[i][max[i]]);
			b=1;
		}
	}
	if(b==0)
		printf("not found\n");
	return 0;
}
int main() {
	int a[6][6];
	int max[6], mp[6];
	int s = 0;
	for ( int i = 1; i <= 5; i ++) {
		for ( int j = 1; j <= 5; j ++) {
			cin >> a[i][j];
		}
	}
	for ( int i = 1; i <= 5; i ++) {
		for ( int j = 1; j <= 5; j ++) {
			if ( j == 1) {max[i] = a[i][j]; mp[i] = j;}
			else if ( a[i][j] > max[i]) { max[i] = a[i][j]; mp[i] = j;}
		}
	}
	for ( int i = 1; i <= 5; i ++) {
		if ( max[i] <= a[1][mp[i]] && max[i] <= a[2][mp[i]] && max[i] <= a[3][mp[i]] && max[i] <= a[4][mp[i]] && max[i] <= a[5][mp[i]]) {
			s += 1;
			cout << i << " " << mp[i] << " " << max[i] << endl;
		}
	}
	if ( s == 0 ) cout << "not found";
	return 0;
}
int main()
{
	int a[5][5] = {{0,0}}, i, j;
	for (i = 0; i <= 4; i++ )
	{
		for (j = 0; j <= 4; j++ )
		{
			cin >> a[i][j];
		}
	}
	int max[5] = {0}, min[5] = {0};
	for (i = 0; i <= 4; i++ )
	{
		for (j = 1; j <= 4; j++ )
		{
			if (a[i][j] > a[i][max[i]])
			{
				max[i] = j;
			}
		}
	}
	for (j = 0; j <= 4; j++ )
	{
		for (i = 1; i <= 4; i++ )
		{
			if (a[i][j] < a[min[j]][j])
			{
				min[j] = i;
			}
		}
	}
	int flag = 0;
	for (i = 0; i <= 4; i++ )
	{
		if (min[max[i]] == i)
		{
			cout << i + 1 << " " << max[i] + 1 << " " << a[i][max[i]] << endl;
			flag = 1;
		}
	}
	if (flag == 0)
	{
		cout << "not found" << endl;
	}

	return 0;
}
main()
{
     int a,b,c,d,e,f;
     int x[5][5];
     f=0;
     for(a=0;a<=4;a++)
     {
            for(b=0;b<=4;b++)
            {
                scanf("%d",&x[a][b]);
            }
        }
      for(a=0;a<=4;a++)
      {
            for(b=0;b<=4;b++)
            {
                d=0;
                for(c=0;c<=4;c++)
                {
                    if(x[a][b]>=x[a][c])
                    d++;
                    else;
                }
                if(d==5)
                break;
                else;
            }
            e=0;
            for(c=0;c<=4;c++)
            {
                if(x[a][b]<=x[c][b])
                e++;
                else;
            }
            if(e==5)
            {
                printf("%d %d %d\n",a+1,b+1,x[a][b]);
                f=1;
            }
            else;
        }
        if(f==0)
        printf("not found");
        else;
}
int main()
{   
	int a[5][5],l[5];
	int m,k,i,j,flag=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>a[i][j];
	for(j=0;j<5;j++)
	{
		l[j]=a[0][j];
		for(i=0;i<5;i++)
			if(l[j]>a[i][j])
				l[j]=a[i][j];
    }
	for(i=0;i<5;i++)
		{
			m=a[i][0];
			k=0;
			for(j=0;j<5;j++)
				if(a[i][j]>m)
					{
						m=a[i][j];
						k=j;
				}
			if(m==l[k])
				{
					cout<<i+1<<' '<<k+1<<' '<<m<<endl;
					flag=1;
			}

	}
		if(flag==0)
			cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int i,j,sz[5][5],a,b,t,e=0,max,min;
	for (i=0;i<5;i++){
		for (j=0;j<5;j++){
			scanf("%d",&sz[i][j]);
		}
	}

    for (i=0;i<5;i++){
         max=sz[i][0];
		for (j=0;j<5;j++){
			if (sz[i][j]>=max){
				max=sz[i][j];
				a=i;
				b=j;
			}
		}
		min=max;
		for (t=0;t<5;t++){
			if (sz[t][b]<=min){
				min=sz[t][b];
			}
		}
		if (max==min){
			e=1;
			break;
		}
	}
	if (e==0){
		printf("not found");
	}else{
		printf("%d %d %d",a+1,b+1,max);
	}
	return 0;
}
int main()
{
  int i,j,n,a[5][5],max,t,q=0;
  for(i=0;i<5;i++)
   for(j=0;j<5;j++)
     scanf("%d",&a[i][j]);
  for(i=0;i<5;i++)
   {
     t=0;
     max=a[i][0];
     n=0;
     for(j=1;j<5;j++)
      if(a[i][j]>max)
        {
          max=a[i][j];
          n=j;
         }
     for(j=0;j<5;j++)
      if(max>a[j][n]) t++;
     if(t==0) {printf("%d %d %d",i+1,n+1,a[i][n]);q++;}
    }
  if(q==0) printf("not found");
    return 0;
}
/*
 * homework.cpp
 *
 *  Created on: 2013-10-30
 *      Author: dyx
 */
int main()
{
	int juzheng[5][5];
	int i,j,k;
	int a,b=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin >> juzheng[i][j];
	int max;
	for(i=0;i<5;i++)//i???j??
	{
		max=0;
		for(j=0;j<5;j++)
		{
			if(max<juzheng[i][j])
				max=juzheng[i][j];

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

				if(a==0)
				{
					cout << i+1<<" "<< j+1 << " " << max;
					b++;
				}
			}
		}




	}
	if(b==0)
		cout << "not found";
















}
int main()
{
  int a[5][5],m=0,p,q,r=1,w=0;
  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++)
    {  
       m=0;
    for(int j=0;j<5;j++)
       {
        if(a[i][j]>m)
         {
          m=a[i][j];
         p=i;
         q=j;
         }
         }
        r=1;
      for(int k=0;k<5;k++)
        if(m>a[k][q])
          {
           r=0;
           break;
           }
        if(r==1)
        {
         cout<<p+1<<" "<<q+1<<" "<<m<<endl;
         w++;
         }
          
     }
     if(w==0)cout<<"not found"<<endl;
  
  return 0;
          
}
int main(){
    int sz[5][5],a,b,i,h[5],z[5];
    for(a=0;a<5;a++){
                     for(b=0;b<5;b++){
                                      scanf("%d",&sz[a][b]);
                                      }
                                      }
    for(a=0;a<5;a++){
                     h[a]=sz[a][0];
                     for(b=1;b<5;b++){
                                      if(sz[a][b]>h[a]){
                                                        h[a]=sz[a][b];
                                                        }
                                                        }
                                                        }
    for(b=0;b<5;b++){
                     z[b]=sz[0][b];
                     for(a=1;a<5;a++){
                                      if(sz[a][b]<z[b]){
                                                        z[b]=sz[a][b];
                                                        }
                                                        }
                                                        }
   i=0;
   for(a=0;a<5;a++){
                    for(b=0;b<5;b++){
                                     if(sz[a][b]==h[a]&&sz[a][b]==z[b]){
                                                                        printf("%d %d %d",a+1,b+1,sz[a][b]);
                                                                        i=1;
                                                                        }
                                                                        }
                                                                        }
   if(i==0){
            printf("not found");
            }
   
   return 0;
   }
int main()
{
	int a[6][6];
	int i,j,flag,l=0,p,k=0;
	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][l]<a[i][j])
				l=j;
		}
		for(p=0,flag=0;p<=4;p++)
		{
			if(p==i)
				continue;
			if(a[i][l]>a[p][l])
			{
				flag=1;
				break;
			}
		}
		if(flag==0)
		{
			k=1;
			printf("%d %d %d",i+1,l+1,a[i][l]);
		}
	}
	if(flag==1&&k==0)
		printf("not found");
	return 0;
}
//#include<cstring>
int main()
{
	int a[6][6];	//????5*5??
	int i,j;	//??i?j??????????
	int hang[6]={0},lie[6];	//??hang[],lie[]???????????????
	//memset(lie,1000000,sizeof(lie));??????????????????????????cstring????
	int flag=0;
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			cin>>a[i][j];	//??5*5??
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			if(a[i][j]>hang[i])
				hang[i]=a[i][j];	//????????
	for(j=1;j<=5;j++)
		{lie[j]=a[1][j];
		for(i=1;i<=5;i++)	
			if(a[i][j]<lie[j])
				lie[j]=a[i][j];	}	//????????
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			{if(hang[i]==lie[j]&&lie[j]==a[i][j])	//??????????????????????????
				{cout<<i<<" "<<j<<" "<<hang[i]<<endl;
				 flag=1;}		//??flag??1
			}
		if(flag==0)cout<<"not found"<<endl;	//??flag??0???????????????if???????
	return 0;
}
int main()
{
 int a[6][6],s[6],h[6],l[6];
 int i,j,p;
 for(i=1;i<=5;i++)
 {
   for(j=1;j<=5;j++)
   scanf("%d",&a[i][j]);
 }
 
 for(i=1;i<=5;i++)  
 {s[i]=0;
  h[i]=0;
  l[i]=0;
  for(j=1;j<=5;j++)
  {if(a[i][j]>s[i]) {s[i]=a[i][j];h[i]=i;l[i]=j;}
  }
 }
 int q=1;
 for(i=1;i<=5;i++)
 {p=0;
  for(j=1;j<=5;j++)
  {
   if(a[j][l[i]]<s[i]){p=1;}
   
  }
 if(p==0) printf("%d %d %d",h[i],l[i],s[i]);
 q=q*p;
 }
 if(q==1) printf("not found");
 
 return 0;   
}
int main()
{
	int a[5][5],i,j,k,x[5]={0},y[5]={0},g=1;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d ",&a[i][j]);
		}
		printf("\n");
	}
	for(i=0;i<5;i++)
	{
		k=a[i][0];
		for(j=0;j<5;j++)
		{
			if(a[i][j]>k)
			{
				k=a[i][j];
				x[i]=j;
			}
		}
	}
	for(i=0;i<5;i++)
	{
		k=a[0][i];
		for(j=0;j<5;j++)
		{
			if(a[j][i]<k)
			{
				k=a[j][i];
				y[i]=j;
			}
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(i==y[j]&&j==x[i])
			{
				g=0;
				printf("%d %d %d\n",i+1,j+1,a[i][j]);
			}
		}
	}
	if(g==1)
		printf("not found");
}
int main()
{
    int juzhen[5][5],pan=0,i,j,max[5],min[5];//juzhen??????,i,j???????????max?????min???? 
    for(i=0;i<5;i++)
    {
                    max[i]=-100000;
                    for(j=0;j<5;j++)
                    {
                                    cin>>juzhen[i][j];
                                    if (juzhen[i][j]>max[i]) max[i]=juzhen[i][j];//????? 
                    }
    }
    for(j=0;j<5;j++)
    {
                    min[j]=100000;
                    for(i=0;i<5;i++)
                    {
                                    if (juzhen[i][j]<min[j]) min[j]=juzhen[i][j];//????? 
                    }
    }
    for(i=0;i<5;i++)
    {
                    for(j=0;j<5;j++)
                    {
                                    if ((juzhen[i][j]==max[i])&&(juzhen[i][j]==min[j])) //?????????????? 
                                    {
                                                                                       cout<<i+1<<" "<<j+1<<" "<<juzhen[i][j];
                                                                                       pan++;//???????pan??? 
                                    }
                    }
    }
    if (pan==0) cout<<"not found";//?????? 
    return 0;
}
int main()
{
	int a[5][5],i,j;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>a[i][j];
	int count=0,temp;
	for(i=0;i<5;i++)
	{
		int max=a[i][0],maxj=0;
		for(j=0;j<5;j++)
		{
			if(a[i][j]>max) 
				{max=a[i][j];
			maxj=j;}
		}
		int g=1;
		for(j=0;j<5;j++)
		{  
			if(a[j][maxj]<max)
			{ 
				g=0;
				break;
			}}
		if(g==1)
		{
			count++;
			cout<<i+1<<" "<<maxj+1<<" "<<max;                  //??????????
			break;
		}
	}
	if(count==0) cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int a[6][6], i, j, i0, j0, k, max, min, count = 0;
		    for(i = 1; i < 6; i++)
		    {
			   for(j = 1; j < 6; j++)
			   {
					cin >> a[i][j];                      //??????
			   }
		    }
			for(i = 1; i < 6; i++)
			{  
				i0 = i;j0=1;
				max = a[i][1];
				for(j = 1; j < 6; j++)
				{ 
					if(max >= a[i][j])continue;
					max = a[i][j]; j0 = j; i0 = i;       //?????????
					
				}
				for(k = 1; k < 6; k++)
				{
					if(max > a[k][j0])break;             //???????????
					
				}
				
				if(k == 6)
				{
					cout << i0<< " " << j0 << " " << max<< endl;
				    count++;
				}
			}
                 if(count == 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]){
              printf("%d %d %d",i+1,j+1,a[i][j]);
              k+=1;
           }
       }
   }
   if(k==0) printf("not found");
   return 0;
}