int main()
{
int m,n;
scanf("%d %d",&m,&n);
int sz[m][n];
int row,col;
for(row=0;row<m;row++){
  for(col=0;col<n;col++){
     scanf("%d ",&sz[row][col]);
  }
}
int a[400],b[400];
int i;
i=0;
for(row=0;row<m;row++){
  for(col=0;col<n;col++){
    if(row==0&&col==0){
       if(sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row+1][col]){
                 a[i]=row;
                 b[i]=col;
                 i++;
       }
    }
    else if(row==0&&col==n-1){
        if(sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row+1][col]){
                a[i]=row;
                 b[i]=col;
                 i++;
         }
    }
    else if(row==m-1&&col==0){
        if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row][col+1]){
                a[i]=row;
                 b[i]=col;
                 i++;
         }
     }
    else if(row==m-1&&col==n-1){
        if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row][col-1]){
               a[i]=row;
                 b[i]=col;
                i++;
         }
     }
    else if(row==0){
         if(sz[row][col]>=sz[row+1][col]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row][col+1]){
           a[i]=row;
           b[i]=col;
            i++;
         }
     }
    else if(row==m-1){
          if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row][col+1]){
             a[i]=row;
           b[i]=col;
             i++;
         }
     }
    else if(col==0){
          if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row+1][col]&&sz[row][col]>=sz[row][col+1]){
             a[i]=row;
           b[i]=col;
            i++;
         }
     }
     else if(col==n-1){
           if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row+1][col]&&sz[row][col]>=sz[row][col-1]){
            a[i]=row;
           b[i]=col;
            i++;
         }
     }
     else if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row+1][col]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row][col+1]){
       a[i]=row;
       b[i]=col;
       i++;
     }

   }
}
int k;
for( k = 0;k < i; k++ ){
      printf("%d %d\n",a[k],b[k]);
}
return 0;
}


int m,n,a[20][20];

int height(int i,int j)
{
	if(i<0||i>=m||j<0||j>=n)return -1;
	else return a[i][j];
}

void check(int i,int j)
{
	if(a[i][j]>=height(i-1,j)&&a[i][j]>=height(i+1,j)&&a[i][j]>=height(i,j-1)&&a[i][j]>=height(i,j+1))cout<<i<<' '<<j<<endl;
}

int main()
{
	int i,j;
	cin>>m>>n;
	for(i=0;i<m;i++)for(j=0;j<n;j++)cin>>a[i][j];
	for(i=0;i<m;i++)for(j=0;j<n;j++)check(i,j);
	return 0;
}


int m,n;
int height[40][40];
double average[40][40];

int main(){
    int i,j;
    scanf("%d%d",&m,&n);
    memset(average,0,sizeof(average));

    for (i=0;i<m;i++){
        for (j=0;j<n;j++) scanf("%d",&height[i][j]);
    }

    for (i=0;i<m;i++){
        for (j=0;j<n;j++){
            int count = 0,sum = 0;
            if (i>0) {
                sum += height[i-1][j];
                count++;
            }
            if (i<m-1) {
                sum += height[i+1][j];
                count++;
            }
            if (j>0) {
                sum += height[i][j-1];
                count++;
            }
            if (j<n-1) {
                sum += height[i][j+1];
                count++;
            }
            average[i][j] = (double) sum / count;
        }
    }

    for (i=0;i<m;i++){
        for (j=0;j<n;j++){
            double maxh;
            maxh = height[i][j];
            if (i>0 && height[i-1][j] > maxh) {
                maxh = height[i-1][j];
            }
            if (i<m-1 && height[i+1][j] > maxh) {
                maxh = height[i+1][j];
            }
            if (j>0 && height[i][j-1] > maxh) {
                maxh = height[i][j-1];
            }
            if (j<n-1 && height[i][j+1] > maxh) {
                maxh = height[i][j+1];
            }
            if (abs(maxh - (double)height[i][j]) < 0.000001) printf("%d %d\n",i,j);
        }
    }

    return 0;
}


int main()
{
	int mount[20][20], m, n, i, j, left, right, up, down;
	cin >> m >> n;
	for (i = 0; i < m; i++)
		for (j = 0; j < n; j++)
			cin >> mount[i][j];
	for (i = 0; i < m; i++)
		for (j = 0; j < n; j++)
		{
			if (j - 1 < 0)
				left = 1;
			else
				if (mount[i][j - 1] <= mount[i][j])
					left = 1;
				else
					left = 0;
			if (j + 1 == n)
				right = 1;
			else
				if (mount[i][j + 1] <= mount[i][j])
					right = 1;
				else
					right = 0;
			if (i - 1 < 0)
				up = 1;
			else
				if (mount[i - 1][j] <= mount[i][j])
					up = 1;
				else
					up = 0;
			if (i + 1 == m)
				down = 1;
			else
				if (mount[i + 1][j] <= mount[i][j])
					down = 1;
				else
					down = 0;
			if (left + right + up + down == 4)
				cout << i << " " << j << endl;
		}
	return 0;
}


void dump()
{
}
void seektop(int *point,int m,int n)
{
 int i,j=0;
 for(j=0;j<m;j++)
 {for(i=0;i<n;i++)
 {

  if(i==0&&j==0)
   point[i]>=point[i+1]&&point[i]>=point[i+20]?printf("%d %d\n",j,i):dump();
  else if(i==n-1&&j==0)
   point[i]>=point[i-1]&&point[i]>=point[i+20]?printf("%d %d\n",j,i):dump();
  else if(j==0)
   point[i]>=point[i+1]&&point[i]>=point[i+20]&&point[i]>=point[i-1]?printf("%d %d\n",j,i):dump();
  else if(i==0&&j!=m-1)
   point[i]>=point[i+1]&&point[i]>=point[i+20]&&point[i]>=point[i-20]?printf("%d %d\n",j,i):dump();
  else if(i==n-1&&j!=m-1)
   (point[i]>=point[i-1]&&point[i]>=point[i+20]&&point[i]>=point[i-20])?printf("%d %d\n",j,i):dump();
  else if(i==0&&j==m-1)
   (point[i]>=point[i+1]&&point[i]>=point[i-20])?printf("%d %d\n",j,i):dump();
  else if(i==n-1&&j==m-1)
   point[i]>=point[i-1]&&point[i]>=point[i-20]?printf("%d %d\n",j,i):dump();
  else if(j==m-1)
   point[i]>=point[i-1]&&point[i]>=point[i-20]&&point[i]>=point[i+1]?printf("%d %d\n",j,i):dump();
  else
   point[i]>=point[i-1]&&point[i]>=point[i+20]&&point[i]>=point[i-20]&&point[i]>=point[i+1]?printf("%d %d\n",j,i):dump();
 }
  point=point+20;//????????point=point+20*j?????????for??????????????????????
 }
}
void main()
{
 int m,n,i,j;
 scanf("%d%d",&m,&n);
 int height[20][20]={'\0'},*point=height[0];
 for(i=0;i<m;i++)
  for(j=0;j<n;j++)
   scanf("%d",&height[i][j]);
  seektop(point,m,n);
}


int m,n;
int height[40][40];
double average[40][40];

int main(){
    int i,j;
    scanf("%d%d",&m,&n);
    memset(average,0,sizeof(average));

    for (i=0;i<m;i++){
        for (j=0;j<n;j++) scanf("%d",&height[i][j]);
    }

    for (i=0;i<m;i++){
        for (j=0;j<n;j++){
            double maxh;
            maxh = height[i][j];
            if (i>0 && height[i-1][j] > maxh) {
                maxh = height[i-1][j];
            }
            if (i<m-1 && height[i+1][j] > maxh) {
                maxh = height[i+1][j];
            }
            if (j>0 && height[i][j-1] > maxh) {
                maxh = height[i][j-1];
            }
            if (j<n-1 && height[i][j+1] > maxh) {
                maxh = height[i][j+1];
            }
            if (abs(maxh - (double)height[i][j]) < 0.000001) printf("%d %d\n",i,j);
        }
    }

    return 0;
}


/*
 * 1.cpp
 *
 *  Created on: 2011-12-25
 *      Author: Administrator
 */
int main()
{
	int i,j,m,n;
	int a[50][50];
	cin>>m>>n;
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
			cin>>a[i][j];
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
		{
			if(a[i+1][j]>a[i][j]) continue;
			if(a[i][j+1]>a[i][j]) continue;
			if(i!=0 && a[i-1][j]>a[i][j])continue;
			if(j!=0 && a[i][j-1]>a[i][j])continue;
			cout<<i<<' '<<j<<endl;
		}
	return 0;
}


int main()  {
    int m,n,row,col,x,y,p,q;
    scanf("%d %d",&m,&n);
    int sz[m+2][n+2];
    for(row=0;row<m+2;row++){
        for(col=0;col<n+2;col++){
            if(row==0||row==m+1||col==0||col==n+1){
                sz[row][col]=0;
            }else{
              scanf("%d",&(sz[row][col]));
            }
        }
    }
    for(row=1;row<m+1;row++){
        for(col=1;col<n+1;col++){
            if(sz[row][col]>=sz[row+1][col]&&sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row-1][col]){
                printf("%d %d\n",row-1,col-1);
            }
        }
    }
    return 0;
}


//*****************************
//*???2011?1?9?         *
//*??????               *
//*?????3                *
//*****************************
int main()//???
{//?????
	int m=0,n=0;
	int gaocheng[100][100];
	cin>>m>>n;
	for(int i=0;i<m;i++)
		for(int j=0;j<n;j++)
			cin>>gaocheng[i][j];
	int x=0,y=0;
	for(x=0;x<m;x++)
	{
		for(y=0;y<n;y++)
		{
			if(x==0)
			{
				if(y==0)
				{
					if(gaocheng[x][y]>=gaocheng[x+1][y]&&gaocheng[x][y]>=gaocheng[x][y+1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else if(y==n-1)
				{
					if(gaocheng[x][y]>=gaocheng[x+1][y]&&gaocheng[x][y]>=gaocheng[x][y-1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else
				{
					if(gaocheng[x][y]>=gaocheng[x+1][y]&&gaocheng[x][y]>=gaocheng[x][y+1]&&gaocheng[x][y]>=gaocheng[x][y-1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
			}
			else if(x==m-1)
			{
				if(y==0)
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y+1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else if(y==n-1)
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y-1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y+1]&&gaocheng[x][y]>=gaocheng[x][y-1])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
			}
			else
			{
				if(y==0)
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y+1]&&gaocheng[x][y]>=gaocheng[x+1][y])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else if(y==n-1)
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y-1]&&gaocheng[x][y]>=gaocheng[x+1][y])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
				else
				{
					if(gaocheng[x][y]>=gaocheng[x-1][y]&&gaocheng[x][y]>=gaocheng[x][y+1]&&gaocheng[x][y]>=gaocheng[x][y-1]&&gaocheng[x][y]>=gaocheng[x+1][y])
						cout<<x<<" "<<y<<endl;
					else continue;
				}
			}
		}
	}
	return 0;
}//?????


double mou[20][20];
int m,n;
int judge(int x,int y)
{
	double sum=0,s=0;
	if(x+1<=m)
	{
		if(mou[x+1][y]<=mou[x][y])
		sum++;
		s++;
	}
	if(x-1>=0)
	{
		if(mou[x-1][y]<=mou[x][y])
		sum++;
		s++;
	}
	if(y+1<=n)
	{
		if(mou[x][y+1]<=mou[x][y])
		sum++;
		s++;
	}
	if(y-1>=0)
	{
		if(mou[x][y-1]<=mou[x][y])
		sum++;
		s++;
	}
	if(sum==s)
	return 1;
	else
	return 0;
}
int main()
{
	cin>>m>>n;
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<n;j++)
		{
			cin>>mou[i][j];
		}
	}
	for(int i=0;i<m;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(judge(i,j))
			cout<<i<<" "<<j<<endl;
		}
	}
	return 0;
}


/*
 * intergratedexercise1.21.cpp
 *
 *  Created on: 2013-12-28
 *      Author: st
 */
int main()
{
	int hill[22][22];
	memset(hill,0,sizeof(hill));
	int m,n;
	cin>>m>>n;
	int i,j;
	for(i=1;i<=m;i++)
		for(j=1;j<=n;j++)
			cin>>hill[i][j];
	for(i=1;i<=m;i++)
		for(j=1;j<=n;j++)
			if(hill[i][j]>=hill[i][j-1]&&hill[i][j]>=hill[i][j+1]&&hill[i][j]>=hill[i-1][j]&&hill[i][j]>=hill[i+1][j])
				cout<<i-1<<' '<<j-1<<endl;

}


int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int main()
{
	int m, n;
	cin >> m >> n;
	double mount[22][22];
	for (int i = 0; i < m; i++)
		for (int j = 0; j < n; j++)
			cin >> mount[i][j];
	for (int i = 0; i < m; i++)
		for (int j = 0; j < n; j++)
		{
			int num = 0;
			double sum = 0;
			int k;
			for (k = 0; k < 4; k++)
			{
				int tempi = i + dx[k];
				int tempj = j + dy[k];
				if (tempi >= 0 && tempi < m && tempj >= 0 && tempj < n)
				{
					if(mount[i][j] < mount[tempi][tempj])
						break;
				}
			}
			if (k == 4)
				cout << i << " " << j << endl;
		}
	return 0;
}


int high(int h,int i,int j);
int away(int i,int j);
int num[30][30],m,n;
int main()
{
	int i,j;
	cin>>m>>n;
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
			cin>>num[i][j];
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)
		if(high(num[i][j],i,j)==1)
			cout<<i<<" "<<j<<endl;
	return 0;
}
int high(int h,int i,int j)
{
	int count1=0;
	if(num[i-1][j]<=h||away(i-1,j)==1)
		count1++;
	if(num[i+1][j]<=h||away(i+1,j)==1)
		count1++;
	if(num[i][j-1]<=h||away(i,j-1)==1)
		count1++;
	if(num[i][j+1]<=h||away(i,j+1)==1)
		count1++;
	if(count1==4)
		return 1;
	return 0;
}
int away(int i,int j)
{
	if(i<0||i>=m)
		return 1;
	if(j<0||j>=n)
		return 1;
	return 0;
}


int main()
{
	int m,n;
	cin >> m >> n;
	int height[200][200];
	int flag[200][200];
	memset(flag, 0, sizeof(flag));
	memset(height, 0, sizeof(height));
	for (int i = 1; i <= m; i++)
		for (int j = 1; j <= n ;j++)
		{
			cin >> height[i][j];
		}
	for (int i = 1; i <= m; i++)
		for (int j = 1; j <= n; j++)
		{
			if (height[i][j] >= height[i - 1][j] && height[i][j] >= height[i + 1][j] && height[i][j] >= height[i][j - 1] && height[i][j] >= height[i][j + 1])
				flag[i][j] = 1;
		}
	for (int i = 1; i <= m; i++)
		for (int j = 1; j <= n; j++)
			if (flag[i][j])
				cout << i - 1 << " " << j - 1 << endl;
	return 0;
}


// for each point x, if x has a higher neighbor, set x = -1
// set an extra wall to reduce times of comparison

int main (void)
{
    int i, j, m, n;

    scanf ("%i %i", &m, &n);
    int block[m+2][n+2], mark[m+2][n+2];
    //initialize the wall
    for (i = 0; i < n + 2; i++) {
        block[0][i] = -1;
        block[m+1][i] = -1;
    }
    for (i = 1; i < m + 1; i++) {
        block[i][0] = -1;
        block[i][n+1] = -1;
    }
    //read blocks
    for (i = 1; i <= m; i++)
        for (j = 1; j <= n; j++) {
            scanf ("%i", &block[i][j]);
            mark[i][j] = 0;
        }
    for (i = 1; i <=m; i++)
        for (j = 1; j <= n; j++)
            if (mark[i][j] != -1) {
                            if (block[i][j] < block[i][j+1]) {
                                            mark[i][j] = -1;
                                            continue;
                            }
                            else if (block[i][j] > block[i][j+1])
                                 mark[i][j+1] = -1;
                            if (block[i][j] < block[i+1][j]) {
                                            mark[i][j] = -1;
                                            continue;
                            }
                            else if (block[i][j] > block[i+1][j])
                                 mark[i+1][j] = -1;
                            if (block[i][j] < block[i-1][j]) {
                                            mark[i][j] = -1;
                                            continue;
                            }
                            else if (block[i][j] > block[i-1][j])
                                 mark[i-1][j] = -1;
                            if (block[i][j] < block[i][j-1]) {
                                            mark[i][j] = -1;
                                            continue;
                            }
                            else if (block[i][j] > block[i][j-1])
                                 mark[i][j-1] = -1;
                            printf ("%i %i\n", i-1, j-1);
            }

    return 0;
}


int a[100][100];

int main()
{
	int m, n;
	int i, j;
	int lenth[150];
	int width[150];
	int count = 0;

	cin >> m >> n;

	memset(a, 0, sizeof(a));

	for(i = 1; i <= m; i ++)
	for(j = 1; j <= n; j ++)
		cin >> a[i][j];

	for(i = 1; i <= m; i ++)
	for(j = 1; j <= n; j ++)
	{
		int tag = 1;

		if(a[i][j] < a[i + 1][j])	tag = 0;
		if(a[i][j] < a[i - 1][j])	tag = 0;
		if(a[i][j] < a[i][j + 1])	tag = 0;
		if(a[i][j] < a[i][j - 1])	tag = 0;

		if(tag == 1)
		{
			lenth[count] = i;
			width[count] = j;
			count ++;
		}
	}

	for(i = 0; i < count; i ++)
		cout << lenth[i] - 1 << ' ' << width[i] - 1 << endl;

}


int main(){
	int m,n,row,col;
	int sz[20][20];

	scanf("%d%d",&m,&n);

   	for(row=0;row<m;row++){
   		for(col=0;col<n;col++){
   			scanf("%d",&sz[row][col]);
   		}
   	}

	for(row=0;row<m;row++){
		for(col=0;col<n;col++){
			if(row==0){
				if(col==0&&sz[0][0]>=sz[0][1]&&sz[0][0]>=sz[1][0]){
					printf("%d %d\n",row,col);
				}else if(col==n-1&&sz[0][n-1]>=sz[0][n-2]&&sz[0][n-1]>=sz[1][n-1]){
					printf("%d %d\n",row,col);
				}else if(sz[0][col]>=sz[0][col-1]&&sz[0][col]>=sz[0][col+1]&&sz[0][col]>=sz[1][col]){
					printf("%d %d\n",row,col);
				}
			}else if(col==0){
				if(row==n-1&&sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row-1][col]){
					printf("%d %d\n",row,col);
				}else if(sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row+1][col]){
					printf("%d %d\n",row,col);
				}
			}else if(row==m-1){
				if(col==n-1&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row-1][col]){
					printf("%d %d\n",row,col);
				}else if(sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row-1][col]){
					printf("%d %d\n",row,col);
				}
			}else if(col==n-1&&sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row+1][col]){
				printf("%d %d\n",row,col);
			}else if(sz[row][col]>=sz[row][col-1]&&sz[row][col]>=sz[row][col+1]&&sz[row][col]>=sz[row-1][col]&&sz[row][col]>=sz[row+1][col]){
					printf("%d %d\n",row,col);
			}

		}
	}

	return 0;
}


int main(){
	int m,n,i,j;
	cin>>m>>n;
	const int M=m,N=n;
	int mount[M][N];
	for(i=0;i<m;i++)
		for(j=0;j<n;j++)cin>>mount[i][j];
	for(i=0;i<m;i++)
		for(j=0;j<n;j++){
			if(i>0)
				if(mount[i-1][j]>mount[i][j])continue;
			if(j>0)
				if(mount[i][j-1]>mount[i][j])continue;
			if(i<m-1)
				if(mount[i+1][j]>mount[i][j])continue;
			if(j<n-1)
				if(mount[i][j+1]>mount[i][j])continue;
			cout<<i<<' '<<j<<endl;
		}
	return 0;
}


int moun[30][30];
int high[30][30];
int main()
{
	int row,col;
	cin>>row>>col;

	for(int i=0;i<=row+1;i++)
		for(int j=0;j<=col+1;j++)
		 moun[i][j]=0;

	for(int i=1;i<=row;i++)
		for(int j=1;j<=col;j++)
			cin>>moun[i][j];

	for(int i=1;i<=row;i++)
		for(int j=1;j<=col;j++)
			if(moun[i][j]>=moun[i-1][j] && moun[i][j]>=moun[i][j-1] && moun[i][j]>=moun[i+1][j] && moun[i][j]>=moun[i][j+1])
				cout<<i-1<<" "<<j-1<<endl;

	return 0;
}


int main(){
	int m,n;
	cin>>m>>n;
	int mountain[m+2][n+2];

	for(int i=0;i<m+2;i++){
		for(int j=0;j<n+2;j++){
			if(i!=0&&j!=0&&i!=m+1&&j!=n+1) cin>>mountain[i][j];
			else mountain[i][j]=-1;
		}
	}

	for(int i=1;i<m+1;i++){
		for(int j=1;j<n+1;j++){
			if(mountain[i][j]!=-1){
				if(!(mountain[i-1][j]>mountain[i][j]||
				mountain[i+1][j]>mountain[i][j]||
				mountain[i][j-1]>mountain[i][j]||
				mountain[i][j+1]>mountain[i][j])){
				cout<<i-1<<" "<<j-1<<endl;
				}
			}
		}
	}
}


// lp.cpp : Defines the entry point for the console application.
//
// ??????.cpp : Defines the entry point for the console application.
//

int main()
{

	int m,n,i,j,a[100][100];
	cin>>m>>n;
	memset(a,0,10000);
	for(i=1;i<m+1;i++)
	{
		for(j=1;j<n+1;j++)
			cin>>a[i][j];
	}
	for(i=1;i<m+1;i++)
		for(j=1;j<n+1;j++)
		{
			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])
				cout<<i-1<<' '<<j-1<<endl;
		}
		return 0;
}


/*
 * xzsd.cpp
 *
 *  Created on: 2012-12-16
 *      Author: patriciaxiao
 */

int main()
{
	int height[25][25]={{0}};
	int top[25][25]={{0}};  //?????
	int i,j;
	int m,n;
	scanf("%d %d",&m,&n);
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			scanf("%d",&height[i][j]);
		}
	}
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(top[i][j]==-1)  //??????????
				continue;
			if(height[i][j]>=height[i-1][j])
			{
				if(height[i][j]>height[i-1][j])
					top[i-1][j]=-1;
			}
			else
				continue;
			if(height[i][j]>=height[i+1][j])
			{
				if(height[i][j]>height[i+1][j])
					top[i+1][j]=-1;
			}
			else
				continue;
			if(height[i][j]>=height[i][j-1])
			{
				if(height[i][j]>height[i][j-1])
					top[i][j-1]=-1;
			}
			else
				continue;
			if(height[i][j]>=height[i][j+1])
			{
				if(height[i][j]>height[i][j+1])
					top[i][j+1]=-1;
			}
			else
				continue;
			printf("%d %d\n",i-1,j-1);
		}
	}
	return 0;
}


int panduan(int a,int b, int c,int d,int e);
int panduan(int a,int b, int c,int d,int e){
    int s=0;
    if(e>=a&&e>=b&&e>=c&&e>=d){
        s=1;
    }
    return s;
}
int main(){
    int m,n,i,j;
    scanf("%d %d",&m,&n);
    int dikuai[m+2][n+2];
    for(i=1;i<m+1;i++){
        for(j=1;j<n+1;j++){
            scanf("%d",&dikuai[i][j]);
        }
    }
    for(j=0,i=0;i<m+2;i++){
        dikuai[i][j]=0;
    }
    for(j=n+1,i=0;i<m+2;i++){
        dikuai[i][j]=0;
    }
    for(j=0,i=m+1;j<n+2;j++){
        dikuai[i][j]=0;
    }
    for(j=0,i=0;j<n+2;j++){
        dikuai[i][j]=0;
    }
    for(i=1;i<m+1;i++){
        for(j=1;j<n+1;j++){
           if(panduan(dikuai[i-1][j],dikuai[i+1][j],dikuai[i][j-1],dikuai[i][j+1],dikuai[i][j])==1){
               printf("%d %d\n",i-1,j-1);
           }
        }
    }
    return 0;

}


struct sha
{
	int gaodu;
	int x;
	int y;
	int shanding;
}mou[100][200],t;
int main()
{
	int m,n;
	cin>>m>>n;
	int i,j;
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			cin>>mou[i][j].gaodu;
			mou[i][j].x=i;
			mou[i][j].y=j;
			mou[i][j].shanding=0;
		}
	}
	for(i=0;i<=m+1;i++)
	{
		mou[i][n+1].gaodu=0;
		mou[i][0].gaodu=0;
	}
	for(i=0;i<=n+1;i++)
	{
		mou[m+1][i].gaodu=0;
		mou[0][i].gaodu=0;
	}
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(mou[i][j].gaodu>=mou[i-1][j].gaodu&&mou[i][j].gaodu>=mou[i+1][j].gaodu&&mou[i][j].gaodu>=mou[i][j-1].gaodu&&mou[i][j].gaodu>=mou[i][j+1].gaodu)
				mou[i][j].shanding=1;
		}
	}
	for(i=1;i<=m;i++)
	{
		for(j=1;j<=n;j++)
		{
			if(mou[i][j].shanding==1)
			{
				cout<<mou[i][j].x-1<<" "<<mou[i][j].y-1<<endl;
			}
		}
	}
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 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, 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 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 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;
}


int max(int a[5][5],int i)
{
	int k = 0;
	int p = 0;
	while(p<5)
	{
		if(a[i][p]>k)
			k = a[i][p];
		p++;
	}
	p = 0;
	while(p<5)
	{
		if(a[i][p] == k)
			return p;
		p++;
	}
}
int judge(int a[5][5],int y,int i)
{
	int j = 0;
	while(j<5)
	{
		if(j == i)
		{
			j++;
			continue;
		}
		else
		{
			if(a[j][y]<a[i][y])
				return 0;
		}
		j++;
	}
	return 1;
}
int main()
{
	int a[5][5];
	int x,y;
	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++)
	{
		y = max(a,i);
		if(judge(a,y,i))
		{
			printf("%d %d %d", i+1,y+1,a[i][y]);
			return 0;
		}
	}
	printf("not found");
	return 0;
}


int main()
{
	int array[6][6]={0};
	int max[6]={0};
	for(int i=1;i<=5;i++)
		for(int j=1;j<=5;j++)
		{
			cin>>array[i][j];
			if(array[i][j]>array[i][max[i]])
				max[i]=j;
		}
	int have=0,result=0;
	for(int i=1;i<=5;i++)
	{
		int flag=1;
		for(int k=1;k<=5;k++)
		{
			if(array[k][max[i]]<array[i][max[i]])
			{
				flag=0;
				break;
			}
		}
		if(flag==1)
		{
			have=1;
			cout<<i<<" "<<max[i]<<" "<<array[i][max[i]]<<endl;
		}
	}
	if(!have)
		cout<<"not found"<<endl;
	return 0;
}


int main()
{
	int a[5][5];
	int i,j;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	int row,col,max;
	for(i=0;i<5;i++)
	{
		max = 0;
		for(j=0;j<5;j++)
		{
			if(a[i][j]>=max)
			{
				max=a[i][j];    row=i;     col=j;
			}
		}
		for(j=0;j<5;j++)
		{
			if(max > a[j][col])   break;
		}
		if(j==5)
		{
			printf("%d %d %d",row+1,col+1,max);
			return 0;
		}
	}
	printf("not found\n");
	return 0;
}


int main()
{
   int i,j;
   int lineMax[5] = {0};
   int columnMin[5];
   int matrix[5][5];
   for( i = 0; i < 5; i++ )
	   for( j = 0; j < 5; j++ )
		   scanf( "%d", &matrix[i][j] );

   for( i = 0; i < 5; i++ )
   {
	   int max = 0;
	   for( j = 1; j < 5; j++ )
	   {
		   if( matrix[i][j] > matrix[i][max] )
			   max = j;
	   }
	   lineMax[i] = max;
   }

   for( i = 0; i < 5; i++ )
   {
	   int min = 0;
	   for( j = 1; j < 5; j++ )
	   {
		   if( matrix[j][i] < matrix[min][i] )
			   min = j;
	   }
	   columnMin[i] = min;
   }

   int record[5];
   int len = 0;
   for( i = 0; i < 5; i++ )
   {
	   if( columnMin[ lineMax[i] ] == i )
	   {
		   record[len] = i;
		   len++;
	   }
   }

   if( len == 0 )
	   printf( "not found\n" );
   else
   {
	   for( i = 0; i < len; i++ )
	   {
		   int line = record[i];
		   int column = lineMax[record[i]];
		   printf("%d %d %d\n",(line+1),(column+1),matrix[line][column]);
	   }
   }
   return 0;
}


int maxi(int b,int c,int d,int e,int f);
int mini(int b,int c,int d,int e,int f);
int main()
{
	int a[5][5],m,n,sum=0;
	for(m=0;m<5;m++)
     {
		for(n=0;n<5;n++)
		{
			scanf("%d",&a[m][n]);
		}

     }
     for(m=0;m<5;m++)
     {
		for (n=0;n<5;n++)
		{
			if((a[m][n]==maxi(a[m][0],a[m][1],a[m][2],a[m][3],a[m][4]))&&(a[m][n]==mini(a[0][n],a[1][n],a[2][n],a[3][n],a[4][n])))
			{
				printf("%d %d %d\n",m+1,n+1,a[m][n]);
				sum++;
			}

		}
	}
	if(sum==0)
	printf("not found");
     return 0;
}

int maxi(int b,int c,int d,int e,int f)
{
	if(b>c)
	c=b;
	if(c>d)
	d=c;
	if(d>e)
	e=d;
	if(e>f)
	f=e;
	return f;
		}
int mini(int b,int c,int d,int e,int f)
{
	if(b<c)
	c=b;
	if(c<d)
	d=c;
	if(d<e)
	e=d;
	if(e<f)
	f=e;
	return f;
		}


int findmin(int a[5])
{
int x=a[0],y=0;
for (int i=1;i<5;i++)
   if (a[i]<x) {x=a[i];y=i;}
return y;
}

int findmax(int a[5])
{
int x=a[0],y=0;
for (int i=0;i<5;i++)
   if (a[i]>x) {x=a[i];y=i;}
return y;
}

int main()
{
int a[5][5],b[5][5],max[5],min[5],pp=0;
for (int i=0;i<5;i++)
   for (int j=0;j<5;j++)
   {scanf("%d",&a[i][j]);b[j][i]=a[i][j];}
for (int i=0;i<5;i++)
   {
   max[i]=findmax(a[i]);
   min[i]=findmin(b[i]);
   }
for (int i=0;i<5;i++)
   if (i==min[max[i]]) {printf("%d %d %d",i+1,max[i]+1,a[i][max[i]]);pp=1;}
if (pp==0) printf("not found");
}


int max(int a,int b,int c,int d,int e)
{
    if(a>b&&a>c&&a>d&&a>e)
    return(a);
    else if(b>a&&b>c&&b>d&&b>e)
    return(b);
    else if(c>a&&c>b&&c>d&&c>e)
    return(c);
    else if(d>a&&d>b&&d>c&&d>e)
    return(d);
    else
    return(e);
}
int min(int a,int b,int c,int d,int e)
{
      if(a<b&&a<c&&a<d&&a<e)
    return(a);
     else if(b<a&&b<c&&b<d&&b<e)
    return(b);
    else if(c<a&&c<b&&c<d&&c<e)
    return(c);
    else if(d<a&&d<b&&d<c&&d<e)
    return(d);
    else
    return(e);
}
main()
{
     int a[5][5],i,j,t=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][j]==max(a[i][0],a[i][1],a[i][2],a[i][3],a[i][4])&&a[i][j]==min(a[0][j],a[1][j],a[2][j],a[3][j],a[4][j]))
                      {
                      printf("%d %d %d",i+1,j+1,a[i][j]);
                      t=1;
                      break;
                      }
                      }
if(t==1)
break;
                      }
                      if(t!=1)
                      printf("not found");

      }


int main()
{
	int a[5][5],i,j,k,n=0,max,min,row,colum;
	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];
			row=i;
			colum=0;
			for(j=1;j<5;j++)
			if(a[i][j]>max)
				{
					max=a[i][j];
					colum=j;
			}
				min=max;
				for(k=0;k<5;k++)
					if(a[k][colum]<min)
						min=a[k][colum];
				if(max==min)
					{
						n++;
						cout << row+1 << " " << colum+1 << " " << max <<endl;
					}
		}
		if(n==0)
			cout << "not found" << endl;
		return 0;
}


int check(int a[5][5],int h,int l)
{
    int i,j;
    for (i=0;i<5;i++)//???
      if (a[h][i]>a[h][l]) return 0;//?????number
    for (i=0;i<5;i++)//scan hang
      if (a[i][l]<a[h][l]) return 0;
    return 1;
}
int main()
{
   int a[5][5],que=30302,n=0,posh,posl;
   int i,j;
   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 (check(a,i,j))
         {
             que=a[i][j];
             posh=i+1;
             posl=j+1;
         }

    if (que!=30302)
      printf("%d %d %d",posh,posl,que);
    else printf("not found");
  return 0;

}


int main()
{
int a[5][5],max=0,row=0,line=0,judge=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++)
         {
         int j=0;
         max=a[i][j];
         line=i;
         row=j;
         for(int j=0;j<5;j++)
             {

             for(int k=j+1;k<5;k++)
                 {
                 if(max<a[i][k])
                    {
                    max=a[i][k];
                    line=i;
                    row=k;
                    }
                 }
             }
          if(max<=a[0][row]&&a[line][row]<=a[1][row]&&a[line][row]<=a[2][row]&&a[line][row]<=a[3][row]&&a[line][row]<=a[4][row])
             {
             printf("%d %d %d",line+1,row+1,max);
             judge=1;
             }
         }
 if(judge==0)
    printf("not found");
}


int main(int argc, char *argv[])
{
  int max=0,flag=0,n=0;
  int row,col;
  int a[6][6]={0};
  int i,j,k;

  for(i=1;i<=5;i++){
                    for(j=1;j<=5;j++){
                                      scanf("%d",&a[i][j]);
                                      }
                    }

  for(i=1;i<=5;i++,max=0){

                    for(j=1;j<=5;j++){
                                      if(a[i][j]>max){
                                                      max=a[i][j];
                                                      row=i;
                                                      col=j;
                                                      }
                                      }

                    for(k=1;k<=5;k++) {
                                     if(a[k][col]<max){flag=1;break;}
                                     }
                    if(flag==0){printf("%d %d %d\n",row,col,max);n++;}
                    else{flag=0;}

                    }
  if(n==0){printf("not found\n");}

  return 0;
}


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];
	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 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 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;
  }


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;
}


/**
* @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;
}


struct dian
{
    int x;
    int y;
    int zhi;
};
int main()
{
   int a[5][5];
   int c,e,i,j,count=0;
   struct dian b[5];
   struct dian andian;
   for(i=0;i<5;i++)
   for(j=0;j<5;j++)
   scanf("%d",&a[i][j]);
   for(i=0;i<5;i++)            //  i ?? ??
   {
                   int d=0;
                   andian.zhi=a[i][0];
                   andian.x=1;
                   andian.y=i+1;
                   for(j=1;j<5;j++)  {if(andian.zhi<a[i][j])  {andian.zhi=a[i][j];andian.x=1+j;}} //?????????
                   c=andian.zhi;
                   for(j=0;j<5;j++) if(a[j][andian.x-1]<c)  d++;
                   if(d==0){printf("%d %d %d\n",andian.y,andian.x,andian.zhi);count++;}
   }
   if(count==0)  printf("not found");
getchar();getchar();getchar();
}


void main()
{
	int a[5][5],c,t=1,i,j,k,max,colum,row;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<5;i++)
	{
		max=a[i][0];
		colum=0;
		row=i;
		for(j=1;j<5;j++)
		{
			if(a[i][j]>max)
			{
				max=a[i][j];
				colum=j;
			}
		}
		c=1;
		for(k=0;k<5;k++){
			if(a[k][colum]<a[row][colum])
				c=0;}
		if(c){printf("%d %d %d",row+1,colum+1,a[row][colum]);t=0;}
	}
	if(t)printf("not found");
}


int max(int n,int *a);
int min(int n,int *a);

int main()
{
	int num0[5][5],num1[5][5];
	for(int i=0;i<5;i++)
	for(int j=0;j<5;j++)
	{
		cin>>num0[i][j];
		num1[j][i]=num0[i][j];
	}
	int flag=1;
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{
			if(num0[i][j]==max(5,num0[i])&&num1[j][i]==min(5,num1[j]))
			{
				cout<<i+1<<' '<<j+1<<' '<<num0[i][j]<<endl;
				flag=0;
				break;
			}
		}
	}
	if(flag)
	cout<<"not found"<<endl;
	return 0;
}

int max(int n,int *a)
{
	int max=a[0];
	for(int i=0;i<n;i++)
	{
		if(a[i]>max)
		max=a[i];
	}
	return max;
}

int min(int n,int *a)
{
	int min=a[0];
	for(int i=0;i<n;i++)
	{
		if(min>a[i])
		min=a[i];
	}
	return min;
}


const int N=5;

int max(int a[])
{
	int i,m=0;
	for(i=1;i<N;i++)
		if(a[i]>a[m]) m=i;
	return m;
}

int min(int a[N][N],int m,int n)
{
	int i;
	for(i=0;i<N;i++)
		if(a[i][n]<a[m][n]) return 0;
	return 1;
}

main()
{
	int a[N][N],i,j,n;
	for(i=0;i<N;i++)
		for(j=0;j<N;j++)
			scanf("%d",*(a+i)+j);
	for(i=0;i<N;i++)
	{
		n=max(a[i]);
		if(min(a,i,n))
		{
			printf("%d %d %d",i+1,n+1,a[i][n]);
			return 0;
		}
	}
	printf("not found");
}


int main(){
	int sz[5][5],hang,lie;
	int row,col,min,i,j;

	for(row=0;row<5;row++){
		for(col=0;col<5;col++){
			scanf("%d",&sz[row][col]);
		}
	}
	i=0;
	for(col=0;col<5;col++){
		min=sz[0][col];
		lie=col;
		for(row=0;row<5;row++){
			if(sz[row][col]<=min){
				min=sz[row][col];
				hang=row;
			}
		}
		j=0;
		col=0;
		while(col<5){
			if(min>=sz[hang][col]){
				j++;
			}
			col++;
		}
		if(j==5){
			printf("%d %d %d\n",hang+1,lie+1,min);
			i++;
		}
		col=lie;

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

	return 0;
}


int main()
{
	int array[6][6];
	int i,j;
    int flag1=1,tmp1,tmp2,flagx=0;
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=5;j++)
		{
			scanf("%d",&array[i][j]);
		}
	}
    i=1;
	j=1;
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=5;j++)
		{
			flag1=1;

			for(tmp1=1;tmp1<=5;tmp1++)
			{
				if(array[i][j]<array[i][tmp1])
					flag1=0;
			}
			for(tmp2=1;tmp2<=5;tmp2++)
			{
				if(array[i][j]>array[tmp2][j])
					flag1=0;
			}
			if(flag1==1)
			{
				printf("%d %d %d",i,j,array[i][j]);
			    flagx=1;
			}
		}
	}
	if(flagx==0)printf("not found");
	return 0;
}


int max(int A,int B,int C,int D,int E){
if(A>B&&A>C&&A>D&&A>E) return A;
else if(B>A&&B>C&&B>D&&B>E) return B;
else if(C>A&&C>B&&C>D&&C>E) return C;
else if(D>A&&D>B&&D>C&&D>E) return D;
else return E;

}
int min(int L,int M,int N,int O,int P){
if(L<M&&L<N&&L<O&&L<P) return L;
else if(M<L&&M<N&&M<O&&M<P) return M;
else if(N<L&&N<M&&N<O&&N<P) return N;
else if(O<M&&O<N&&O<L&&O<P) return O;
else return P;
}
int main(){
	int a[5][5],i,j,k=0;
	for(i=0;i<5;i++)
		cin>>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++){
			if(a[i][j]==max(a[i][0],a[i][1],a[i][2],a[i][3],a[i][4])
					&&a[i][j]==min(a[0][j],a[1][j],a[2][j],a[3][j],a[4][j])){
		cout<<i+1<<' '<<j+1<<' '<<a[i][j]<<endl;
		k++;
			}
		}
	if(k==0)
		cout<<"not found"<<endl;
	return 0;
}


int main()  //?????
{
	int a[6][6],line,row,flag=0;
	for (int i=1;i<=5;i++)
	{
		for (int t=1;t<=5;t++)
			cin >> a[i][t];
	}
	for (int k=1;k<=5;k++)
	{
		int count=0,max=0;
		for (int p=1;p<=5;p++)
		{
			row = k;
			if (a[k][p]>max)
			{
				max=a[k][p];
				line = p;

			}

		}

		for (int q=1;q<=5;q++)
		{

			if (a[q][line]>=max)
			{
				count++;
			}
		}
			if (count==5)
			{
				flag++;
				cout << row << " " << line << " " << a[row][line] << endl;
			}
	}
	if (flag==0)
		cout << "not found" << endl;
	return 0;
}


int main()
{
	int array[5][5],min[5],max[5],imax[5],imin[5];
	int i,j;
	char flag=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			cin>>array[i][j];
	for(i=0;i<5;i++)
	{
		imax[i]=array[i][0];
		max[i]=0;
		for(j=1;j<5;j++)
			if(array[i][j]>imax[i])
			{
				imax[i]=array[i][j];
				max[i]=j;
			}
	}
	for(j=0;j<5;j++)
	{
		imin[j]=array[0][j];
		min[j]=0;
		for(i=1;i<5;i++)
			if(array[i][j]<imin[j])
			{
				imin[j]=array[i][j];
				min[j]=i;
			}
	}
	for(i=0;i<5;i++)
		if(min[max[i]]==i)
		{
			cout<<i+1<<' '<<max[i]+1<<' '<<imax[i]<<endl;
			flag=1;
		}
	if(flag==0)
		cout<<"not found"<<endl;
	return 0;
}


int main()
{
	int a[5][5],f=0,min=INT_MAX,temp,I=0;
	for(int i=0;i<5;i++)
		for(int j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	do
	{
		for(int i=0;i<5;i++)
		{
			if(min>=a[i][f])
			{
				min=a[i][f];
				temp=i;
			}
		}
		for(int j=0;j<5;j++)
		{
			if(min<a[temp][j])
				break;
			if(j==4)
			{
				cout<<temp+1<<" "<<f+1<<" "<<min<<endl;
				I++;
			}
		}
		f++;
		min=INT_MAX;
	}while(f<5);
	if(I==0)
	{
		cout<<"not found"<<endl;
	}
	return 0;
}


int main ()
{
	int a[6][6] , hang1 , hang2 , lie , i , j , k , max , min , flag = 1 ;
	for ( i = 1 ; i <= 5 ; i++ )
	{
		for ( j = 1 ; j <= 5 ; j++ )
		{
			cin >> a[i][j];
		}
	}
	for ( i = 1 ; i <= 5 ; i++ )
	{
		max = a[i][1] ;
		hang1 = i ;
		lie = 1 ;
		for ( j = 1 ; j <= 5 ; j++ )
		{
			if ( a[i][j] >= max )
			{
				max = a[i][j] ;
				lie = j ;
			}
		}
	    min = a[hang1][lie] ;
		for ( k = 1 ; k <= 5 ; k++ )
		{
			if ( a[k][lie] <= min )
			{
				min = a[k][lie] ;
				hang2 = k ;
			}
		}
	    if ( hang1 == hang2 )
		{
		    cout << hang1 << ' ' << lie << ' ' << a[hang1][lie] << endl ;
			flag = 0 ;
			break ;
		}
        else if ( hang1 != hang2 )
		{
		    continue ;
		}
	}
	if ( flag )
	{
		cout << "not found" << endl ;
	}
	return 0 ;
}


int max(int a,int b,int c,int d,int e);
int min(int a,int b,int c,int d,int e);

int main()
{
	int sz[5][5];
	int row=0;
	int col=0;
	int refer=0;
	for(row=0;row<5;row++)
	{
		for(col=0;col<5;col++)
		{
			scanf("%d",&sz[row][col]);
		}
	}
	for(row=0;row<5;row++)
	{
		for(col=0;col<5;col++)
		{
			if(sz[row][col]==max(sz[row][0],sz[row][1],sz[row][2],sz[row][3],sz[row][4]) && sz[row][col]==min(sz[0][col],sz[1][col],sz[2][col],sz[3][col],sz[4][col]))
			{
				refer=1;
				printf("%d %d %d\n",row+1,col+1,sz[row][col]);
			}
		}
	}
	if(refer==0)
	{
		printf("not found");
	}
	return 0;
}

int max(int a,int b,int c,int d,int e)
{
	int x=a;
	if(b>x)
	{
		x=b;
	}
	if(c>x)
	{
		x=c;
	}
	if(d>x)
	{
		x=d;
	}
	if(e>x)
	{
		x=e;
	}
	return x;
}

int min(int a,int b,int c,int d,int e)
{
	int x=a;
	if(b<x)
	{
		x=b;
	}
	if(c<x)
	{
		x=c;
	}
	if(d<x)
	{
		x=d;
	}
	if(e<x)
	{
		x=e;
	}
	return x;
}


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");
}


/*
 * 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], i, j, max, row, line, flag = 0;
	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];
		row = i;
		line = 0;
		for (j = 0; j < 5; j ++)
		{

			if (a[i][j] > max)
			{
				max = a[i][j];
				row = i;
				line = j;
			}
		}
		int k;
		for (k = 0; k < 5; k ++)
		{
			if (a[k][line] >= max)
				continue;
			else
				break;
		}
		if (k == 5)
		{
			flag = 1;
			cout<<row + 1<<" "<<line + 1<<" "<<max<<endl;
		}
	}
	if (flag == 0)
		cout<<"not found"<<endl;
	return 0;
}


int main()
{
    int num[6][6],max_hang[6],min_lie[6];
    memset(max_hang,0,sizeof(max_hang));
    memset(min_lie,1,sizeof(min_lie));
    int i,j;
    for(i=1;i<=5;i++)
    for(j=1;j<=5;j++)
    cin>>num[i][j];
    for(i=1;i<=5;i++)
    for(j=1;j<=5;j++)
    {
        if(num[i][j]>max_hang[i])max_hang[i]=num[i][j];
        if(num[i][j]<min_lie[j])min_lie[j]=num[i][j];
    }
    for(i=1;i<=5;i++)
    for(j=1;j<=5;j++)
    {
        if(num[i][j]==max_hang[i]&&num[i][j]==min_lie[j])
        {
            cout<<i<<' '<<j<<' '<<num[i][j]<<endl;
            return 0;
        }
    }
    cout<<"not found";
}


int main()
{
	int a[5][5], i, j, k, flag = 0;
	int lineMax = 0, columnMin = 0, ione = 0, jone = 0 , itwo = 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 (j == 0)
			{
				lineMax = a[i][0];
				ione = i;
			}
			else
				if (lineMax < a[i][j])
				{
					lineMax = a[i][j];
					jone = j;
					ione = i;
				}
		}

		for (k = 0; k < 5; k++)
		{
			if (k == 0)
				columnMin = a[0][jone];
			else
				if (columnMin > a[k][jone])
				{
					columnMin = a[k][jone];
					itwo = k;
				}
		}
		if (itwo == ione)
		{
			cout << itwo + 1 << " " << jone + 1 << " " << a[itwo][jone] << endl;
		    flag = 1;
		}
		lineMax = 0; columnMin = 0; ione = 0; jone = 0; itwo = 0;
	}
	if (flag == 0)
		cout << "not found" << endl;
	return 0;
}


int main() {
	int a[5][5] = { 0 }, i, j, max1[5], least1[5], t = 0;

	int max_value(int x, int max);
	int least_value(int x, int least);

	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, max1[i] = a[i][0], least1[i] = a[0][i]; j < 5; j++) {
			max1[i] = max_value(a[i][j], max1[i]);
			least1[i] = least_value(a[j][i], least1[i]);
		}
	}
	for (i = 0; i < 5; i++)
		for (j = 0; j < 5; j++)
			if (max1[i] == a[i][j] && least1[j] == a[i][j]) {
				cout << i + 1 << " " << j + 1 << " " << a[i][j] << endl;
				t = t + 1;
			}

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

	return 0;
}

int max_value(int x, int max) {
	if (x > max)
		return x;
	else
		return max;
}
int least_value(int x, int least) {
	if (x > least)
		return least;
	else
		return x;
}


int main()
{
int a[5][5];
int i,j,max,min,col1,andian,k;
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];col1=0;
for(j=0;j<5;j++)
	if(a[i][j]>max)
		{max=a[i][j];

col1=j;}
andian=1;
for(k=0;k<5;k++)
if(max>a[k][col1])
	{andian=0;
continue;
}
if(andian==1)
{cout<<i+1<<" "<<col1+1<<" "<<max<<endl;
break;}
}
if(andian!=1)
cout<<"not found"<<endl;
return 0;
}


main()
{
	int matrix[5][5];
	for (int i=0;i<=4;i++)
		for (int m=0;m<=4;m++)
			scanf ("%d",&matrix[i][m]);
	int c=0;
	for (int n=0;n<=4;n++)
		for (int l=0;l<=4;l++)
			{
				int max=matrix[n][l];
				for (int a=0;a<=4;a++)
					{
						if (matrix[n][a]>max)
						max=matrix[n][a];
						else
						max=max;
					}
				int min=matrix[n][l];
				for (int b=0;b <=4;b++)
					{
						if (matrix[b][l]<min)
						min=matrix[b][l];
						else
						min=min;
					}
				if (max==matrix[n][l]&&min==matrix[n][l])
				{
				printf("%d %d %d",n+1,l+1,max);
				c++;
			    }
			}
	if (c==0)
	printf ("not found");

}


int main()
{
	int num[5][5],counter=0;
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{cin>>num[i][j];}
		cout<<endl;
	}
	for(int i=0;i<5;i++)
	{
		for(int j=0;j<5;j++)
		{
			int mid=0,second=0;
			for(int k=0;k<5;k++)
			{
			   mid+=(num[i][j]>num[i][k]);
			}
			if(mid==4)
			{
			   for(int l=0;l<5;l++)
			{
					second+=(num[i][j]<num[l][j]);
			}
			if(second==4)
			{cout<<i+1<<" "<<j+1<<" "<<num[i][j]<<endl;
			counter++;}
			}
		}
	}
	if(counter==0)
		cout<<"not found";
	return 0;
}


int main()
{
  int a[5][5];
  int i,j;
  int status,col,row,judge;
  int cmp;
  col=row=status=cmp=judge=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(a[i][j]>cmp)
		 {
			 cmp=a[i][j];
			 col=i;
			 row=j;
		 }
		 if(j==4)
		 {
			 status=1;
		 }
	  }
		 int p;
		 for(p=0;p<5;p++)
		 {
			 if(a[p][row]>=cmp)
				 continue;
			 else
			 {status=0;
			 break;
			 }
		 }
		 if(status==1)
		 {
			 printf("%d %d %d",col+1,row+1,a[col][row]);
			 status=0;
			 judge=1;

		 }
		  cmp=0;
  }
	 if(judge==0)
	 printf("not found");
	 return 0;
  }


int max(int array[][5],int n,int i)
{
	int j,m;
	m=array[i][0];
	for(j=0;j<n;j++)
	m=m>array[i][j]?m:array[i][j];
	return m;
}
int min(int array[][5],int n,int j)
{
	int i,m;
	m=array[0][j];
	for(i=0;i<n;i++)
	m=m<array[i][j]?m:array[i][j];
	return m;
}

int main()
{
	int a[5][5];
	int i,j,k=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]==max(a,5,i)&&a[i][j]==min(a,5,j))
			{
				cout<<i+1<<" "<<j+1<<" "<<a[i][j]<<endl;
				k++;
			}
		}
	}
	if(k==0)
	cout<<"not found";
	return 0;
}


int main()
{
 int an,hang,lie,i,r,a[5][5],paohuierhao=0;
 for(i=0;i<5;i++)
 {
  for(r=0;r<5;r++)
  scanf("%d",&a[i][r]);
 }
 for(i=0;i<5;i++)
 {
  int paohui=0;
  an=a[i][0];
  hang=i+1;
  lie=1;
  for(r=0;r<5;r++)
  {
   if(an<a[i][r])
   {
    an=a[i][r];
    lie=r+1;
   }
  }
  for(r=0;r<5;r++)
  {
   if(an>a[r][lie-1])
   {
    paohui++;
    break;
   }
  }
  if(paohui==0)
  {
   printf("%d %d %d",hang,lie,an);
   paohuierhao++;
  }
 }
if(paohuierhao==0)
printf("not found");
return 0;
}


int main(){
	int number[5][5],i,p,judge[5][5],name,min,max;
	for(i=0;i<5;i++){for(p=0;p<5;p++){scanf("%d",&number[i][p]);judge[i][p]=0;}}
	for(i=0;i<5;i++){max=number[i][0];name=0;for(p=0;p<5;p++){if(number[i][p]>max){name=p;max=number[i][p];}}   judge[i][name]++;}
	for(p=0;p<5;p++){min=number[0][p];name=0;for(i=0;i<5;i++){if(number[i][p]<min){name=i;min=number[i][p];}}   judge[name][p]++;}
	for(i=0;i<5;i++){for(p=0;p<5;p++){if(judge[i][p]==2){printf("%d %d %d",i+1,p+1,number[i][p]);return 0;}}}
	printf("not found");

    return 0;}


int main()
{
	int a[5][5];
	int i,j;
	int column[5];
	int max,exist,flag;
	exist = 0;
	flag = 0;
    for (i = 0; i <= 4; i++)
		for (j = 0; j <= 4; j++)
		{
			cin >> a[i][j];
		}
	for (i = 0; i <= 4; i++)
	{
		max = a[i][1];
		column[i] = 1;
		for (j = 0; j <= 4; j++)
		{
			if (a[i][j] > max)
			{
				max = a[i][j];
				column[i] = j;
			}
		}
	}
	for (i = 0; i <= 4; i++)
	{
		for (j = 0; j <= 4; j++)
		{
			if (a[i][column[i]] > a[j][column[i]])
			{
				exist = 0;
				break;
			}
			else
				exist = 1;
		}
		if (exist == 1)
		{
			cout << i+1 << " " << column[i]+1 << " " << a[i][column[i]] << endl;
			flag = 1;
		}
	}
	if (flag == 0)
		cout << "not found" << endl;
return 0;
}


int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	int i, j, k, column=-1;
	int arr[5][5];
	for (i = 0; i < 5; ++ i) for (j = 0; j < 5; ++ j) cin >> arr[i][j];
	for (i = 0; i < 5; ++ i)
	{
		for (j = 0; j < 5; ++ j)
		{
			for (k = j+1; k < 5; ++ k)
				if (arr[i][j] < arr[i][k]) break;
			if (k == 5)
			{
				column = j;
				break;
			}
		}
		for (j = 0; j < 5; ++ j)
			if (arr[i][column] > arr[j][column]) break;
		if (j == 5)
		{
			cout << i+1 << " " << column+1 << " " << arr[i][column] << endl;
			break;
		}
	}
	if (i == 5) cout << "not found\n";
}


int max(int array[5][5],int n)
{
	int t=array[n][0],i;
	for(i=0;i<5;i++)
	{
		if(t<array[n][i])
		t=array[n][i];
		else;
	}
	return t;
}
int min(int array[5][5],int n)
{
	int t=array[0][n],i;
	for(i=0;i<5;i++)
	{
		if(t>array[i][n])
		t=array[i][n];
		else;
	}
	return t;
}
int main()
{
	int max(int array[5][5],int x);
	int min(int array[5][5],int x);
	int a[5][5],i,j,t,count=0,andian;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&a[i][j]);
		}
		printf("\n");
	}
	for(t=0;t<5;t++)
	{
		andian=max(a,t);
		for(i=0;i<5;i++)
		{
			if(andian==min(a,i))
			{
				printf("%d %d %d\n",t+1,i+1,andian);
				break;
			}
			else
			count++;
		}
	}
	if(count==25)
	printf("not found\n");

	return 0;
}


int main()
{
	int a[5][5],i,j,count=1,p,max;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<5;i++)
	{
		max=0;
		for(j=1;j<5;j++)
		{
			if(a[i][j]>a[i][max])
				max=j;
		}
		for(p=0;p<5;p++)
		{
			if(p==i)
				continue;
			if(a[i][max]>a[p][max])
				break;
		}
		if(p==5)
		{
			printf("%d %d %d\n",i+1,max+1,a[i][max]);
			count++;
		}
	}
	if(count==1)
		printf("not found\n");
	return 0;
}


int main(void)
{
	int map[5][5],max[5],t,i,j,t_max;
	char b=1;
	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=0;
		}
	}
	if(b)
		printf("not found\n");
	return 0;
}


int main()
{
	int a[5][5];
	int row,col,an,i;
	for(row=0;row<5;row++)
	{
		for(col=0;col<5;col++)
		{
			scanf("%d",&a[row][col]);
		}
	}
	int max,min,flag=1,k=1;
	for(row=0;row<5;row++)
	{
		for(col=0;col<5;col++)
		{
			flag=1;
			max=a[row][col];
			min=max;
			for(i=0;i<5;i++)
			{
				if(a[row][i]>max)
				{
					flag=0;
					break;
				}
				if(a[i][col]<min)
				{
					flag=0;
					break;
				}
			}
			if(flag)
			{
				printf("%d %d %d",row+1,col+1,a[row][col]);
				k=0;
			}
		}
	}
	if(k) printf("not found");
	return 0;
}


int main()
{
int i,j,k,a[N][M],max,maxj,flag;
for(i=0;i<N;i++)
for(j=0;j<M;j++)
scanf("%d",&a[i][j]);
for(i=0;i<N;i++)
{ max=a[i][0];
maxj=0;
for(j=0;j<M;j++)
if(a[i][j]>max)
{ max=a[i][j];
maxj=j;
}

flag=1;

for(k=0;k<N;k++)
if(max>a[k][maxj])
{ flag=0;
continue;}

if (flag)
{ printf("%d %d %d\n",i+1,maxj+1,max);
break;
}
}
if(!flag)
printf("not found\n");
}


main()
{
      int a[5][5];
      int i,j,k;
      for(i=0;i<5;i++)
      for(j=0;j<5;j++)
      scanf("%d",&a[i][j]);
      int max,maxj,flag;
      for(i=0;i<5;i++)
      {
                      max=a[i][0];
                      maxj=0;
                      for(j=0;j<5;j++)
                      {
                                      if(a[i][j]>max)
                                      {
                                                     max=a[i][j];
                                                     maxj=j;
                                      }
                      }
                      flag=1;
                      for(k=0;k<5;k++)
                      if(max>a[k][maxj])
                      {
                                        flag=0;
                                        continue;
                      }
                      if(flag)
                      {
                              printf("%d %d %d",i+1,maxj+1,max);
                              break;
                      }
      }
      if(flag==0)
      printf("not found\n");
      getchar();
      getchar();
      }


//
//  Created by Chu-Pan,Wong on Nov 11, 2013.
//  Copyright (c) 2013 ChuPan,Wong. All rights reserved.
//

int main(int argc, char** argv){
    int m[5][5];
    for (int i=0; i<5; i++) {
        for (int j=0; j<5; j++) {
            cin>>m[i][j];
        }
    }
    int rowmax[5];
    for (int i=0; i<5; i++) {
        int max=m[i][0];
        for (int j=1; j<5; j++) {
            if(m[i][j]>max)
                max = m[i][j];
        }
        rowmax[i] = max;
    }
    int colmin[5];
    for (int j=0; j<5; j++) {
        int min=m[0][j];
        for (int i=1; i<5; i++) {
            if(m[i][j]<min)
                min = m[i][j];
        }
        colmin[j] = min;
    }
    int cnt=0;
    for (int i=0; i<5; i++) {
        for (int j=0; j<5; j++) {
            if(m[i][j]==rowmax[i]&&m[i][j]==colmin[j]){
                cnt++;
                cout<<i+1<<" "<<j+1<<" "<<m[i][j]<<endl;
            }
        }
    }
    if(cnt==0)
        cout<<"not found"<<endl;
    return 0;
}


int sushu(long n)
{
	int i;
	for(i=2;i<=sqrt(n);i++)
	{
		if(n%i==0)
		{
			return(0);
			break;
		}
	}
	if(i>sqrt(n))
		return(1);
}
int huiwen(long n)
{
	long s=0,k;
	k=n;
	while(n>0)
	{
		s=s*10+n%10;
		n=n/10;
	}
	if(k==s)
		return(1);
	else
		return(0);
}
void main()
{
	long m,n,i,j,k,s=0;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(sushu(i)&&huiwen(i))
			s=s+1;
	}
	if(s==0)
		printf("no\n");
	for(i=m;i<=n;i++)
	{
		if(sushu(i)&&huiwen(i))
		{
			printf("%d",i);
			k=i;

			break;
		}
	}
	for(j=k+1;j<=n;j++)
	{
		if(sushu(j)&&huiwen(j))
		{
			printf(",%d",j);

		}
	}
	printf("\n");

}


int su(int x)
{
	int i,b=1;
	for (i=2;i<=sqrt(x);i++)
		if (x%i==0) {b=0;break;}
	return(b);
}
int hw(int x)
{
	int n,s=0;
	n=x;
	while (n>0)
	{
		s=s*10+n%10;
		n=n/10;
	}
	if (s==x) return(1);
	else return(0);
}
void main()
{
	int m,n,i,b=0;
	scanf("%d %d",&m,&n);
	for (i=m;i<=n;i++)
		if (su(i))
			if (hw(i))
				if (b==0) {printf("%d",i);b=1;}
				else printf(",%d",i);
	if (b==0) printf("no");
}


void main()
{
	int f(int i);
	int g(int i);
	int i,m,n,k=0,j;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(f(i)==0&&g(i)==0)
		{
			printf("%d",i);
			k++;
		break;}
	}
	for(j=i+1;j<=n;j++)
	{
		if(f(j)==0&&g(j)==0)
		{
			printf(",%d",j);
			k++;
		}
	}
	if(k==0)
		printf ("no");
}
int f(int i)
{
	int r;
	for(r=2;r<=sqrt(i);r++)
		if(i%r==0)
		{
			return 1;
			break;
		}
	return 0;
}
int g(int i)
{
	int h(int x);
	int k,j=0,s;
	k=i;
	while(k>=10)
	{k=k/10;
	j++;
	}
	for(s=0;s<j;s++)
		if((i%h(s+1)-i%h(s))/h(s)!=(i/h(j-s))%10)
			return 1;
	return 0;
}
int h(int x)
{
	int s=1,i;
	for(i=0;i<x;i++)
		s=s*10;
	return s;
}


void main()
{
	long int m,n,i;
	void primechart(int *p);
	int prime(long int n,int *p);
	int check(int n,int i);
	int p[32001]={0},*ppr;
	int l,len;
	scanf("%d%d",&m,&n);
	ppr=p;
	p[2]=1;
	primechart(ppr);
	l=0;
	for(i=m;i<=n;i++)
	{
		len=(int)log10(i)+1;
		if((p[i]==1)&&(check(i,len)))
			if(l==0) {printf("%d",i);l++;}
			else printf(",%d",i);
	}
	if(l==0) printf("no");
	printf("\n");
}

void primechart(int *p)
{
	int i,j;
	for(i=4;i<=32000;i=i+2) *(p+i)=-1;
	for(i=3;i<=32000;i=i+2)
		if(*(p+i)==0)
		{
			*(p+i)=1;
			for(j=2*i;j<=32000;j=j+i)
				*(p+j)=-1;
		}
}

int prime(long int n,int *p)
{
	int i;
	for(i=3;i<=sqrt(n);i=i+2)
		if((*(p+i)==1)&&(n%i==0)) return 0;
	return 1;
}

int check(int n,int i)
{
	int j;
	char s[10];
	//printf("%d %d\n",n,i);
	for(j=0;j<=i-1;j++)
	{
		s[j]='0'+n%10;
		n=n/10;
	}
	s[i]='\0';
	for(j=0;j<=i/2;j++)
		if(s[j]!=s[i-1-j]) return 0;
	return 1;
}


int hui(int a);
int su(int a);
void main()
{
	int m,n,i,j=0,a[99];
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(hui(i)==1&&su(i)==1)
		{
			a[j]=i;
			j++;
		}
		else continue;
	}
	if(j>=1)
	{
		printf("%d",a[0]);
		for(i=1;i<j;i++) printf(",%d",a[i]);
	}
	else printf("no");
	printf("\n");
}
int hui(int a)
{
	int ne=0,b;
	b=a;
	while(b!=0)
	{
		ne=ne*10+b%10;
		b=b/10;
	}
	if(ne==a) return 1;
	else return 0;
}
int su(int a)
{
	int i,b,k=1;
	b=a/2;
	if(a==1) k=0;
	if(a==2) k=1;
	else
	for(i=2;i<=b;i++)
	{
		if(a%i==0)
		{
			k=0;break;
		}
		else continue;
	}
	return k;
}


int main()
{
	int m,n,i,j,k,chush,yush,sush,weish,meiwei[10],geshu=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		for(chush=2,sush=1;chush<=i/2;chush++)
		{
			if(i%chush==0) sush=0;
		}
		if(sush==1)
		{
			weish=(int)log10(i)+1;
			for(k=i,j=0;j<weish;j++)
			{
				meiwei[j]=k%10;
				k=k/10;
			}
			for(k=0,j=0;j<weish;j++)
			{
				k=k+meiwei[weish-1-j]*(int)pow(10,j);
			}
			if(i==k)
			{
				printf("%d",i);
				geshu++;
				break;
			}
		}
	}
	for(i++;i<=n;i++)
	{
		for(chush=2,sush=1;chush<=i/2;chush++)
		{
			if(i%chush==0) sush=0;
		}
		if(sush==1)
		{
			weish=(int)log10(i)+1;
			for(k=i,j=0;j<weish;j++)
			{
				meiwei[j]=k%10;
				k=k/10;
			}
			for(k=0,j=0;j<weish;j++)
			{
				k=k+meiwei[weish-1-j]*(int)pow(10,j);
			}
			if(i==k)
			{
				printf(",%d",i);
				geshu++;
			}
		}
	}
	if(geshu==0) printf("no");
}


int sushu(int x)
{
    int i;
    if(x==2)
        return 1;
    for(i=2;i<=sqrt(x);i++)
        {
        if(x%i==0)
        return 0;
        }
    return 1;
}
int huiwen(int x)
{
    int p[500],q[500],i,j,y;
    y=x;
    for(i=0;;i++)
        {
        p[i]=x%10;
        x=(x-p[i])/10;
        if(x==0)
        break;
        }
        x=y;
    for(j=i;j>=0;j--)
       {
         q[j]=x%10;
         x=(x-q[j])/10;
        if(x==0)
        break;
       }
    for(j=0;j<=i;j++)
       {
       if(p[j]!=q[j])
       return 0;
       }
     return 1;
}
main()
{
  int m,n,count=0,i;
  scanf("%d %d",&m,&n);
  for(i=m;i<=n;i++)
      {
      if(sushu(i)==0)
      continue;
      else
      {
             if(i/10==0&&count==0)
                 {
                 printf("%d",i);
                 count++;
                 }
             else if(i/10==0&&count!=0)
                 {
                 printf(",%d",i);
                 count++;
                 }
             else if(i>=10&&huiwen(i)==1&&count==0)
                {
                 printf("%d",i);
                 count++;
                }
             else if(i>=10&&huiwen(i)==1&&count!=0)
                {
                 printf(",%d",i);
                 count++;
                }
      }

      }
      if(count==0)
      printf("no");
}


int sushu(int n)
{
    int i;
    for(i=2;i<n;i++)
    {
       if(n%i==0)
        break;
    }
    if(i==n)
     return 1;
    else
     return 0;
}
int huiwenshu(int m)
{
    int d,m1;
     m1=m;
      for(d=0;m!=0;)
      {
           d=d*10+m%10;
           m=m/10;
      }
      if(m1==d)
       return 1;
      else
       return 0;
}
main()
{
     int m,n,i,count=0;
     scanf("%d %d",&m,&n);
     for(i=m;i<=n;i++)
     {
          if(huiwenshu(i)==1)
          {
                if(sushu(i)==1)
                {
                  if(count==0)
                  {
                    printf("%d",i);
                    count++;
                  }
                  else
                   printf(",%d",i);
                }
          }
     }
     if(count==0)
       printf("no");
     getchar();
     getchar();
}


int sushu(int n)
{
	int i,flag=1;
	for(i=2;i<n/2;i++)
	{
		if(n%i==0)
		{flag=0;break;}
	}
	return(flag);
}
int huiwen(int n)
{
	char a[10];
	int i=0,flag=0,j;
		while(n!=0)
		{
			a[i]=n%10;
			n=n/10;
			i++;
		}
		a[i]='\0';
	for(j=0;j<i/2;j++)
	{
		if(a[j]!=a[i-j-1]) break;
	}
	if (j==i/2) flag=1;
	return(flag);
}

void main()
{
	int m,n,i,flag=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if (sushu(i))
		   if (huiwen(i))
		   {
			   if (flag==0) {printf("%d",i);flag++;}
			   else printf(",%d",i);
		   }
	}
	if(flag==0) printf("no");
}


int hui(int x);
int su(int x);
int main()
{
    int m,n,i,j,t=0;
    scanf("%d%d",&m,&n);
    for(i=m;i<=n;i++)
    {
        if(hui(i)==1)
        {
                     if(su(i)==1)
                     {
                                 printf("%d",i);
                                 for(j=i+1;j<=n;j++)
                                 if(su(j)==1&&hui(j)==1)break;
                                 if(j<=n)printf(",");
                     }
                     else t++;
        }
        else t++;
    }
    if(t==n-m+1)printf("no");
}
int su(int x)
{
    int i,q;
    q=sqrt(x);
    for(i=2;i<=q;i++)
    if(x%i==0)break;
    if(i<=q)return(0);
    else return(1);
}
int hui(int x)
{
    int i,p,sum=0,temp;
    temp=x;
    for(i=1;;i++)
    if(x/(int)pow(10,i)==0)break;
    p=i;
    for(i=p;i>0;i--)
    {
        sum=sum*10+temp%10;
        temp=temp/10;
    }
    if(sum==x)return(1);
    else return(0);
}


int isHuiWen(int n)
{
	int m = n;
	int a=0;
	while(m)
	{
		a = a * 10 + m % 10;
		m /= 10;
	}
	return(a==n);
}

int isPrime(int n)
{
	double max = sqrt((double)n);
	for(int i = 2;i<=max;i++)
	{
		if(n%i == 0)
			return 0;
	}
	return 1;
}

int main(void)
{
	int m,n;
	int j = 0;
	scanf("%d%d",&m,&n);
	for(int i = m;i<=n;i++)
	{
		if(isHuiWen(i)&&isPrime(i))
		{
			if(j)printf(",");
			printf("%d",i);
			j++;
		}
	}
	if(j == 0)
		printf("no");
	return 0;
}


int A(int k)
{
	int i;
	for(i=2;i<k;i++)
	{
		if(k%i==0)
		{
			return 0;
		}
	}
	return 1;
}
int B(int k)
{
	int s=0,t;
	t=k;
	while(k>0)
	{
		s=s*10+(k%10);
		k/=10;
	}
	if(s==t){
		return 1;
	}
	else{
		return 0;
	}
}
int main()
{
	int m,n,k;
	int first=1,flag=1;
	scanf("%d %d",&m,&n);
	for(k=m;k<=n;k++)
	{
		if(A(k)&&B(k)){
			if(first){
			    printf("%d",k);
			    first=0;
			}
		         else{
				printf(",%d",k);
			}
			flag=0;
		}
	}
	if(flag)
	{
		printf("no");
	}
	return 0;
}


int huiwen(int a)
{
	int b=0;
	int i=0;
	int l=1;
	int c=1;
	for(l=0;l<12;l++)
	{
		if((a/c)==0)
		break;
		c=c*10;
	}
	c=a;
	for(i=1;i<=l;i++)
	{
		b=b*10;
		b=b+(c%(10));
		c=(c/10);
	}
	if(a==b)
	return 1;
	else
	return 0;
}
int ss(int a)
{
	int i=2;
    for(i=2;i<=(a/2);i++)
    {
        if((a%i)==0)
        return 0;
    }
    return 1;
}
int main()
{
	int m,n;
	scanf("%d %d",&m,&n);
	int i=0,k=0;
	for(i=m;i<=n;i++)
	{
		if(i!=1)
		if(huiwen(i))
		{
			if(ss(i))
			{
				k=k+1;
				if(k!=1)
				printf(",%d",i);
				else
				printf("%d",i);
			}
		}
	}
	if(k==0)
	printf("no");
	return 0;
}


int su(int num)
{
	int i;
	for(i=2;i<num;i++)
		if(num%i==0) return(0);
	return(1);
}
int hui(int num)
{
	int a,b=0;
	a=num;
	while(num!=0)
	{
		b=b*10+num%10;
		num/=10;
	}
	if(a==b) return(1);
	else return(0);
}
void main()
{
	int m,n,flag=0,i,a[20],k=0;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
		if(su(i)==1&&hui(i)==1)
		{
			flag=1;
			a[k++]=i;
		}
	if(flag==0) printf("no");
	else
	{
		for(i=0;i<k-1;i++) printf("%d,",a[i]);
		printf("%d",a[i]);
	}
}


int sushu(int n)
{
	int d=1,i;
	if (n==1) d=0;
	else if(n==2) d=1;
	else
	{
		for (i=2;i<=n-1;i++)
			if (n%i==0)
			{
				d=0;break;
			}
	}
	return (d);
}
int huiwen(int n)
{
	int m,s=0,d=0,t;
	t=n;
	while(n!=0)
	{
	m=n%10;
	n=n/10;
	s=s*10+m;
	}
	if (s==t) d=1;
	return d;
}
main()
{
	int m,n,i,k,s=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		int x=sushu(i);int y=huiwen(i);
		if(x==1&&y==1)
		{
			printf("%d",i);s++;
			break;
		}
	}
	for (k=i+1;k<=n;k++)
	{
		int x=sushu(k);int y=huiwen(k);
		if(x==1&&y==1)
		{
			printf(",%d",k);
		}
	}
	if (s==0) printf("no");
return 0;
}


int r(int n)
{
    int m,d=0;
    m=n;
    while(m!=0)
    {
               d=d*10+m%10;
               m=m/10;
    }
    return n==d;
}
int test(int n)
{
    int j;
    for(j=2;j<=n/2;j++)
    if(n%j==0)
    return 0;
    return 1;
}
int main()
{
    int m,n,l=0,c=0;
    int i;
    scanf("%d %d",&m,&n);
    for(i=m;i<=n;i++)
    {
                   if(r(i)&&test(i))
                   {
                                    if(l==0)
                                    {printf("%d",i);
                                    l=1;}
                                    else
                                    printf(",%d",i);
                   }
                   else c++;

    }
    if(c==n-m+1)
    printf("no");
    getchar();
    getchar();

}


int ss(int n)
{
	int i;
	for(i=2;i<n/2+1;i++)
		if(n%i==0)
			return 0;
	return 1;
}
int hw(int n)
{
	int i,c,sum=0;
	c=n*10;
	for(i=0;(c=c/10)!=0;i++)
		sum=sum*10+c%10;
	if(sum==n)
		return 1;
	else
	return 0;
}
void main()
{
	int n,m,i,k=0,a[100];
	scanf("%d %d",&n,&m);
	for(i=n;i<=m;i++)
		if(ss(i)&&hw(i))
		{
			a[k]=i;
			k++;
		}
	if(k==0)
		printf("no");
	else
	{
		for(i=0;i<k-1;i++)
			printf("%d,",a[i]);
		printf("%d",a[k-1]);
	}
}


int checksu(int n)
{
int i=2;
int m=0;
for(i=2;i*i<=n;i++)
{
if(n%i==0)
{m=1;
break;}
}
if(m==1)
return 0;
else
return 1;
}
int checkhui(int n)
{
int i=0,a[100],j;
while(n!=0)
{
i++;
a[i]=n%10;
n=n/10;
}
for(j=1;j<i;j++)
{
  if (a[j]!=a[i+1-j])
  break;
        }
if (j==i)
return 1;
else
return 0;
}
main()
{
  int a,b,c[1000],l,k=0;
  scanf("%d",&a);
  scanf("%d",&b);
                 for(l=a;l<=b;l++)
                 {
                      if(checksu(l)==1&&checkhui(l)==1)
                      {
                      c[k]=l;
                      k++;
                      }
                 }
 if (k==0)
 printf("no\n");
 else
     {
       for (int p=0;p<=k-1;p++)
       {printf("%d",c[p]);
       if(p!=k-1)
       printf(",");
       }
     }
getchar();
getchar();
getchar();
}


int hw(int m)
{
	int s = 0;
	int t = m;
	for (; m!=0;m=m/10)
	{
		s =10*s +m%10;

	}
	if (s==t)return 1;
	else return 0;
}
int zx(int m)
{
	int i;
	if (m%2==0) return 0;
	for (i=3; i<m/2; i+=2)
		if (m%i==0) return 0;
		return 1;
}
int main()
{
	int i;
	int m;
	int n;
	int k=0;
	scanf("%d%d", &m, &n);
	for (i=m; i<n+1; i++)
		if ( hw(i)==1&&zx(i)==1)
		{
			if (k==0) k = 1;
			else printf(",");
			printf("%d", i);
		};
if (k==0) printf("no");
		return 0;
}


int prime(int a)
{     int k,i;
      k=sqrt(a);
	  for(i=2;i<=k;i++)
		  if(a%i==0)  {return 0;
		                break;}
	  if(i>k)  return 1;
}
int hw(int b)
{     int a[20]={0},j=0,l;
      while(b!=0)
	  {
	     a[j]=b%10;
		 b=(b-a[j])/10;
		 j++;
	  }
	  for(l=0;l<=(j-1);l++)
		  if(a[l]!=a[j-1-l]) { return 0;
		                        break;}
		return 1;
}
void main()
{
	int s,m,n,flag=1;
	scanf("%d %d",&m,&n);
	for(s=m;s<=n;s++)
		if(prime(s)&&hw(s))
		{if(flag==0){printf(",");}
		printf("%d",s);
		flag=0;}
	if(flag==1) printf("no\n");
}


int hw(int n)
{
	int m=0,i;
	if(n/10==0)return 1;
	else
	{
		i=n;
		do
		{
			m=m*10+n%10;
			n=n/10;
		}while(n!=0);
		if(m==i)return 1;
		else return 0;
	}
}
int ss(int n)
{
	int i;
	for(i=2;i<=n;i++)if(n%i==0)break;
	if(i==n)return 1;
	else return 0;
}
void main()
{
	int m,n,i,j=0,a[100]={0};
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)if(hw(i)&&ss(i))a[j++]=i;
	if(j==0)printf("no");
	else{for(i=0;i<j-1;i++)printf("%d,",a[i]);printf("%d",a[i]);}
}


int su(int a);
int hui(int b);
int wei(int c);
void main()
{
   int m,n,i;
   int a[500];
   int k=0;
   scanf("%d %d",&m,&n);
	   for(i=m;i<=n;i++)
   {
     if(su(i)&&hui(i))
	 {
		a[k]=i;
		k=k+1;
	 }
   }
	   int j;
   if(k>0)
   {
	   printf("%d",a[0]);
	   for(j=1;j<k;j++) printf(",%d",a[j]);
   }
   else printf("no");
}

int wei(int c)
{
   if     (c/100000) return 6;
   else if(c/10000) return 5;
   else if(c/1000 ) return 4;
   else if(c/100 ) return 3;
   else if(c/10 ) return 2;
   else return 1;

}

int su(int a)
{
  int f;
  int flag=1;
  for(f=2;f<a/2;f++)
  {
	  if(a%f==0) {flag=0;break;}
  }
  if(flag) return 1;
  else return 0;
}

int hui(int b)
{
  int w,g;
  w=wei(b);
  int c[8];
  for(g=w-1;g>=0;g--)
  {
     c[g]=b%10;
	 b=b/10;
  }
  int fla=1;
  for(g=0;g<w;g++)
  {
    if(c[g]!=c[w-1-g]) fla=0;
  }
  if (fla==1) return 1;
  else return 0;
}


void main()
{
	int F(int i);
	int G(int i);
	int m,n,i,a[400],b=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if((F(i)==1)&&(G(i)==1))
		{
			a[b]=i;b++;
		}
	}
	if(b!=0)
	{
		printf("%d",a[0]);
		for(i=1;i<b;i++)
		printf(",%d",a[i]);
	}
	else printf("no");
}

int F(int i)
{
	int e,k;
	k=sqrt(i);
	for(e=2;e<=k;e++)
	if(i%e==0) break;
	if(e>k) return(1);
	else return(0);
}
int G(int i)
{
	int f,g=0;
	f=i;
	while(g<f) {g=g*10+i%10;i=i/10;}
	if(g==f) return(1);
	else return(0);
}


int su(int n)
{
    int j;
    for(j=2;j<n;j++)
      if(n%j==0)
       break;
     if(j==n)
      return(1);
      else
      return(0);
}
int main()
{
    int n,m,a,b[100],i,j,k,q=0;
    scanf("%d %d",&m,&n);
    for(i=m;i<=n;i++)
      if((su(i))==1)
        {
           a=i;
          for(j=0;;j++)
             {b[j]=a%10;
            a=a/10;
              if(a==0)
               break;
              }
           for(k=0;k<j;k++)
             if(b[k]!=b[j-k])
                 break;
             if(k==j)
             {if(q!=0)
                 printf(",");
                q++;
              printf("%d",i);
              }}
       if(q==0)
         printf("no");
       getchar();
       getchar();
}


int tran(long int x)
{
	int t=0,y=x;
	while(y>0)
	{
		t=10*t+y%10;
		y/=10;
		tran(y);
	}
	if (x==t)
		return(1);
	return(0);
}
int cc(long int x)
{
	long int i;
	for (i=2;i<x;i++)
		if (x%i==0)
			break;
	if (i<x-1)
		return(0);
	return(1);
}
void main()
{
	int label=0;
    long int m,n,i,j,p=0;
	scanf("%ld%ld",&m,&n);
	for (i=m;i<=n;i++)
	{
		if (cc(i)==1 && tran(i)==1)
		{
			label++;
			if (label==1)
				printf("%ld",i);
			else printf(",%ld",i);
		}
	}
	if (label==0)
		printf("no\n");
}


int sushu(int x)
{
	int i,m,z=1;
	m=(int)sqrt(x);
	for(i=2;i<=m;i++)
		if(x%i==0)
			z=0;
	return z;
}

int huiwen(int x)
{
	int a=0,m,z=0;
	for(m=x;m!=0;)
	{
		a=a*10+m%10;
		m=m/10;
	}
	if(a==x)
		z=1;
	return z;
}

void main()
{
	int m,n,i,j=0;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
		if(sushu(i) && huiwen(i))
		{
			if(j!=0)
				printf(",");
			j=1;
			printf("%d",i);
		}
	if(j==0)
		printf("no");
	printf("\n");
}


int panduan(int m)
{
	int k,i=0,j,s=0;
	int n;
	n=m;
	do
	{
		n=n/10;
		i++;
	}while(n>0);
	n=m;
	for(j=0;j<i;j++)
	{
		k=n%10;
		n=n/10;
		s=10*s+k;
	}

	if(m==s)
		return 1;
	else
		return 0;
}
int shushu(int m)
{
	int flag=0;
	int i,j;
	if(m==1)
		return 0;
	for(i=2;i<m;i++)
	{
		if(m%i==0)
		{
			flag=1;
			break;
		}
	}
	if(flag==1)
		return 0;
	else
		return 1;
}

int main()
{
	int m,n,flag=0;
	scanf("%d%d",&m,&n);
	for(;m<=n;m++)
	{
		if(panduan(m)==1&&shushu(m)==1)
		{
			if(flag==0)
			{
				printf("%d",m);
				flag++;
			}
			else
			{
				printf(",%d",m);
				flag++;
			}
		}
	}
	if(flag==0)
	{
		printf("no");
	}
	return 0;
}


void main()
{	int huiwen(int a);
	int sushu(int b);
	int m,n,i,t=0;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
		if(huiwen(i)==1&&sushu(i)==1) {printf("%d",i);t++;break;}
	for(i=i+1;i<=n;i++)
		if(huiwen(i)==1&&sushu(i)==1) printf(",%d",i);
	if(t==0) printf("no");
	scanf("%d",&n);
}
int huiwen(int a)
{	int k,t=0,s;
    s=a;
	while(a>0)
	{	k=a%10;
		a=a/10;
		t=t*10+k;
	}
	if(s==t) return(1);
	else return(0);
}
int sushu(int b)
{	int i;
	for(i=2;i<=b;i++)
		if(b%i==0) break;
	if(b==i) return(1);
	else return(0);
}


void main()
{
	int m,n;
	scanf("%d %d",&m,&n);
	int i,j,k;
	int a,b,c;
	c=0;
	for(i=m;i<=n;i++)
	{
		k=sqrt(i);
		for(j=2;j<=k;j++)
		{
			if(i%j!=0)
				continue;
			else
				break;
		}
		if(j>k)
		{
			a=i;
			b=0;

			while(a>0)
			{
				b=b*10+a%10;
				a=a/10;
			}
			if(i==b)
			{
				if(c>=1)
					printf(",");
				printf("%d",i);
				c++;
			}
		}
	}
	if(c==0)
		printf("no");
}


int f(long x)
{
	long i;
	for(i=2;i*i<=x;i++)
	{
		if(x%i==0)return 1;
	}
	return 0;
}
int g(long x)
{
	char c[200]={0},i=0,j;
	while(x>0)
	{
		c[i]=x%10;
		i++;
		x=x/10;
	}
	for(j=0;j<i;j++)
	{
		if(c[j]!=c[i-j-1])return 1;
	}
	return 0;
}
int main()
{
	long m,n,i,t=0;
	scanf("%ld%ld",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(f(i)+g(i)==0)
		{
			if(t==0){printf("%ld",i);t++;}
			else printf(",%ld",i);
		}
	}
	if(t==0)printf("no\n");
	return 0;
}


int pp(int a){
	int i;
for(i=2;i<a/2+1;i++)
if(a%i==0){return 0;break;}
if(i==a/2+1)return 1;}

int ppp(int a,int b){
int m[10];
int i;
for(i=0;i<b;i++){
 m[i]=a%10;
 a=a/10;}
for(i=0;i<=b/2;i++){
 if(m[i]!=m[b-i-1])break;}
if(i==b/2+1)return 1;
else return 0;}

int qq(int a){
 int k;
 for(k=0;a>0;k++)
  a=a/10;
 return k;}

void main(){

 int m,n,i,j,k=0,b,c,v=0;

 scanf("%d %d",&m,&n);

 for(i=m;i<=n;i++){

  b=pp(i);
  if(b){j=qq(i);
  c=ppp(i,j);}

  if(b*c){printf("%d",i);k=1;v=i;break;}}

if(v==0) v=m;

for(i=v+1;i<=n;i++){

  b=pp(i);
  if(b){j=qq(i);
  c=ppp(i,j);}

  if(b*c){printf(",%d",i);k=1;}}

 if(k==0)printf("no");

   }


int Reverse(int num,int renum)
{
	if(num==0)return renum;
	else return Reverse(num/10,renum*10+num%10);
}
int isReverse(int n)
{
	if(Reverse(n,0)==n)
		return 1;
	else
		return 0;
}
int isPrime(int n,int limit,int num)
{
	if(num>limit) return 1;
	else if(n%num==0) return 0;
	else return isPrime(n,limit,num+1);
}

int main()
{
	int n,m,i,j=0;
	int limit,a[300];
	char str[300];
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		limit=sqrt(i);
		if(isPrime(i,limit,2)&&isReverse(i))
		      a[j++]=i;
	}
	for(i=0;i<j-1;i++)
		str[i]=',';
	str[j-1]='\n';
	for(i=0;i<j;i++)
		printf("%d%c",a[i],str[i]);
	if(j==0)
		printf("no\n");
	return 0;
}


void main()
{
	int sushu(int);
	int huiwen(int);
	int n,m;
	int x;
	int count=0;
	scanf("%d %d",&m,&n);
    for(x=m;x<=n;x++)
	{
		if(sushu(x)==1&&huiwen(x)==1)
		{
			if(count==0)
			{
				printf("%d",x);
			}
			else
			{
				printf(",%d",x);
			}
			count++;
		}
	}
	if(count==0)
	{
		printf("no\n");
	}
}
int sushu(int x)
{
	int i,k=0,j;
	j=(int)(sqrt(x))+1;
	for(i=2;i<=j;i++)
	{
	    if(x%i==0&&x!=i)
		{
			break;
		}
	}
	if(i==j+1)
	{
		k=1;
	}
	return(k);
}
int huiwen(int x)
{
	int z=0;
	int y=0;
	int i,k;
	k=x;
	while(x!=0)
	{
	i=x-(int)(x/10)*10;
	y=y*10+i;
	x=(int)(x/10);
	}
	if(y==k)
	{
		z=1;
	}
	return(z);
}


int sushu(int n)
{
	int i;
	if(n==2) return 1;
	if(n%2==0) return 0;
	for(i=3;i<=sqrt(n);i+=2)
	    if(n%i==0) return 0;
	return 1;
}
int huiwen(int n)
{
	int l,a[10],i,m,p;
	l=log10(n)+1;
	for(i=1;i<=l;i++)
	{
		p=pow(10,i);
		a[i-1]=(n%p)/pow(10,i-1);
	}
	for(i=0,m=0;i<l;i++)
		m+=a[l-1-i]*pow(10,i);
	if(n==m) return 1;
	else return 0;
}

void main()
{
	int a,b,j,k,out[100];
	scanf("%d%d",&a,&b);
	for(j=a,k=0;j<=b;j++)
	{
		if(sushu(j)&&huiwen(j))
		{
			out[k]=j;
			k++;
		}
	}
	if(k==0) printf("no");
	else
	{
		for(j=0;j<k-1;j++)
			printf("%d,",out[j]);
		printf("%d",out[k-1]);
	}
}


int prime(int n)
{
	int i,m;
	m=sqrt(n);
	for(i=2;i<=m;i++)
	{
		if(n%i==0)
			return 0;
	}
	return 1;
}
int huiwen(int n)
{
	int m=0,k=n;
	while(k>0)
	{
		m*=10;
		m+=k%10;
		k/=10;
	}
	if(m==n)
		return 1;
	else
		return 0;
}
int main()
{
	int m,n,i,mark=0;
	scanf("%d%d",&m,&n);
	i=m;
	while(i<=n)
	{
		if(prime(i)&&huiwen(i))
		{
			printf("%d",i);
			mark=1;
			i++;
			break;
		}
		i++;
	}
	if(mark==0)
		printf("no\n");
	else
		while(i<=n)
		{
			if(prime(i)&&huiwen(i))
				printf(",%d",i);
			i++;
		}
		return 0;
}


int check1(int n)
{
	int i,flag=1;
	for (i=2;i<=(int)fabs(sqrt(n));i++)
		if (n%i==0)
		{flag=0;break;}
	return(flag);
}
int check2(int n)
{
	int a[10],i,l=0,flag=1;
	while (n>0)
	{l++;a[l]=n%10;n=n/10;}
	for (i=1;i<=l/2;i++)
		if (a[i]!=a[l+1-i])
		{flag=0;break;}
    return(flag);
}
void main()
{
	int flag=0,i,m,n;
	scanf("%d%d",&m,&n);
	for (i=m;i<=n;i++)
		if (check1(i) && check2(i))
		{
			if (flag==0)
			{flag=1;printf("%d",i);}
			else
			  printf(",%d",i);
		}
	if (flag==0) printf("no\n"); else printf("\n");
}


void main()
{
	long int m,n;
	long int oho(int x);
	scanf("%d%d",&m,&n);
	long int i,j,k=0,save[2000],l,x,y=0;
	for(i=m;i<=n;i++)
	{
		if(i==1)
		{
			y++;
			continue;
		}
		else if(i==2)
		{
			save[k]=i;
			k++;
			y++;
		}
		else
		{
			for(j=2;j<i;j++)
			{
				if(i%j==0)break;
			}
			if(j==i)
			{
				save[k]=i;
				k++;
			}
			else y++;
		}
	}
	long int r=0;
	for(l=0;l<k;l++)
	{
		if(oho(save[l])==save[l])
		{
			printf("%d",save[l]);
			break;
		}
		else r++;
	}
    if(r==k)printf("no");
	for(x=l+1;x<k;x++)
	{
		if(oho(save[x])==save[x])
		{
			printf(",%d",save[x]);
		}
	}
}
long int oho(int x)
{
	int r,c=0;
	while(x>=1)
	{
		r=x%10;
		x=x/10;
        c=c*10+r;
	}
	return(c);
}


int sushu(int x)
{
	int ii,t=1;
	for(ii=2;ii<=(int)sqrt(x);ii++)
	{
		if(x%ii==0)
			t=0;
	}
	if(t==1)
		return 1;
	else
		return 0;
}

int huiwen(int y)
{
	int k,t;
	t=y;k=0;
	while(t!=0)
	{
		k=k*10+t%10;
		t=t/10;
	}
	if(k==y)
		return 1;
	else
		return 0;
}

int main()
{
	int m,n,i,a[100],j=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(sushu(i)==1&&huiwen(i)==1)
		{
			j++;
			a[j]=i;
		}
	}
	if(j==0)
		printf("no");
	else
	{
		printf("%d",a[1]);
		for(i=2;i<=j;i++)
			printf(",%d",a[i]);
	}
	return 0;
}


int Isprime(int k);
int Ishuiwen(int k);

int main()
{
	int m,n,i,t;
	int a[100];
	scanf("%d%d",&m,&n);

    t=0;
	for(i=m;i<=n;i++)
	{
		if(Isprime(i))
		{
			if(Ishuiwen(i))
			{
				a[t]=i;
				t++;
			}
		}
	}

	if(t==0)
		printf("no\n");
	else
	{
		printf("%d",a[0]);
		for(i=1;i<t;i++)
			printf(",%d",a[i]);
		printf("\n");
	}

	return 0;
}

int Isprime(int k)
{
	int j;
	for(j=2;j<k;j++)
	{
		if(k%j==0)
			return 0;
	}
	return 1;
}

int Ishuiwen(int k)
{
	int j,p,q,sum,temp;
	j=0;
	temp=k;
	while(temp>0)//why not k/pow(10,j)>0//
	{
		j++;
		temp=temp/10;
	}

	p=j;

	q=k;
	sum=0;
	while(k/(pow(10,j))<k)
	{
		sum=sum+(q%10)*(int)pow(10,(j-1));
		q=q/10;
		j--;
	}

	if(sum==k)
		return 1;
	else
		return 0;
}


int funa(int x);
int funb(int y);
int main()
{
	int m,n,i,k=0;
	int a[100]={0};
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(funb(i)==1)
			if(funa(i)==1)
			{
		    	a[k]=i;
		    	k++;
			}
	}
	if(a[0]==0) printf("no\n");
		else
		{
			printf("%d",a[0]);
			for(i=1;a[i]!=0;i++)
			{
				printf(",%d",a[i]);
			}
		}
	return 0;
}

int funa(int x)
{
	int j;
	for(j=2;j<x;j++)
	{
		if(x%j==0) break;
	}
	if(j==x) return 1;
	else return 0;
}
int funb(int y)
{
	int temp,a,n;
	temp=y;
	n=0;
	while(temp>0)
	{
		a=temp%10;
		n=n*10+a;
		temp=temp/10;
	}
	if(n==y) return 1;
	else return 0;
}


int f1(int x)
{   int c=0;
    for(int i=2;i<=sqrt(x);i++)
    if(x%i==0)
    c++;
    return c;
}
int f2(int x)
{
    int a,b=0;
    while(x>0)
    {
          a=x%10;
          b=b*10+a;
          x=x/10;
    }
    return b;

}
int main()
{
    int m,n;
    scanf("%d %d",&m,&n);

    int hs[1000];
    int d=0;
    for(int i=m;i<=n;i++)
    {
          if(f1(i)==0&&f2(i)==i)

          {hs[d]=i;
          d++;}

    }
    if(d==0)
    printf("no");
    else
    {
        printf("%d",hs[0]);
        for(int p=1;p<d;p++)
        printf(",%d",hs[p]);
    }
 }


void main()
{
	int su(int x);
    int hw(int y);
    int m,n,i,sum=0;
	int b[100]={0};
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
	if(su(i)!=0&&hw(i)!=0)
	{
		b[sum]=i;
	    sum++;
	}
	}

	if(sum==0)
		printf("no");
	else
	{
    for(i=0;i<sum-1;i++)
		printf("%d,",b[i]);
	printf("%d",b[sum-1]);
	}
}

int su(int x)
{
	int i,flag=1;
	for(i=2;i<=sqrt(x);i++)
	{
		flag=x%i;
		if(flag==0)
			break;
	}
	return(flag);
}

int hw(int y)
{
	int a[100],i=0,l,flag,mul=1;
	while(y>0)
	{
		a[i]=y%10;
		y=(y-a[i])/10;
		i++;
	}
	l=i;
	for(i=0;i<l/2;i++)
	{
		if(a[i]==a[l-i-1])
			flag=1;
		else
			flag=0;
		mul*=flag;
	}
	return(mul);
}


int sushu(int s);
int huiwen(int s);
main()
{
      int m,n,num=0,i;
      scanf("%d %d",&m,&n);
      for(i=m;i<=n;i++)
      {
               if((sushu(i)==0)&&(huiwen(i)==0))
               {
                    num++;
                    if(num==1)
                    printf("%d",i);
                    else
                    printf(",%d",i);
               }
      }
      if(num==0)
      printf("no\n");
      getchar();
      getchar();
}
int sushu(int s)
{
    int k=0,i;
    if(s!=1)
    {
    for(i=2;i*i<=s;i++)
    {
         if(s%i==0)
         {
               k=1;
               break;
         }
    }
    return k;
    }
    else
    return 0;
}
int huiwen(int s)
{
     int p=0,r;
     r=s;
     for(;s!=0;)
     {
          p=p*10+s%10;
          s=s/10;
     }
     if(r==p)
     return 0;
     else
     return 1;
}


int sushu (int i)
{
	int m,n=1;
	if (i==2) return (1);
	else
	for (m=2;m<=i-1;m++)
	{
		if (i%m==0)
		{
			n=0;
			break;
		}

	}
   if (n==1) return 1;
		else return 0;
}

int huiwen (int n)
{
	int i,j,k,m=0;
    j=0;
	k=n;
	for (i=0;j==0;i++)
	{
		if (k/10==0) j=1;
	    k=k/10;
	}

	k=n;
	for (j=1;j<=i;j++)
	{
		m=m*10+k%10;
        k=k/10;
	}
 	if (m==n) return 1;
	else return 0;
}

void main()
{
     int huiwen (int);
     int sushu (int);
     int a,b,c,i,j;
     c=0;
     scanf("%d %d",&a,&b);
	 for (i=a;i<=b;i++)
	 {
		 if (huiwen(i)*sushu(i)!=0)
		 {
			 if (c==1) printf(",");
			 printf("%d",i);
			 c=1;

		 }

	 }
	 if (c==0) printf("no\n");
}


char huiwen(int n)
{
	int i,k,a,b;
	k=1;i=0;
	while(k<=n)
	{
		k=k*10;
		i++;
	}
	k=k/10;
	while(i!=1&&i!=0)
	{
		a=n/k;
		b=n%10;
		if(a==b)
		{
			n=(n-k*a-b)/10;
			i=i-2;
			k=k/100;
		}
		else break;
	}
	if(i==1||i==0) return('T');
	else return('F');
}
char sushu(int n)
{
	int i,k;
	if(n==2) return('T');
	else
	{
		if(n%2==0) return('F');
		else
		{
			k=sqrt((double)n);
			for(i=3;i<=k;i=i+2)
			{
				if(n%i==0) break;
			}
			if(i>k) return('T');
			else return('F');
		}
	}
}
void main()
{
	int m,n,i,a[1000],no;
	scanf("%d %d",&m,&n);
	no=0;
	for(i=m;i<=n;i++)
	{
		if(sushu(i)=='T'&&huiwen(i)=='T')
		{
			a[no]=i;
			no++;
		}
	}
	if(no==0) printf("no");
	else
	{
		printf("%d",a[0]);
		for(i=1;i<no;i++) printf(",%d",a[i]);
	}
}


int hui(int i)
{
    int a[20],j,k;
    for(j=0;i!=0;j++)
    {
         a[j]=i%10;
         i=i/10;
    }
    for(k=0;k<j/2;k++)
    if(a[k]!=a[j-k-1])
    break;
    if(k==j/2)
    return 0;
    else
    return 1;
}
int su(int i)
{
    int j;
    for(j=2;j<i;j++)
    if(i%j==0)
    break;
    if(i==j)
    return 0;
    else
    return 1;
}
int main()
{
    int m,n,s=0;
    scanf("%d %d",&m,&n);
    for(int i=m;i<=n;i++)
    {
            if(hui(i)==0)
            {
                         if(su(i)==0)
                         {
                                     s++;
                                     if(s==1)
                                     printf("%d",i);
                                     else
                                     printf(",%d",i);
                         }
            }
    }
    if(s==0)
    printf("no");
    getchar();
    getchar();
}


int sushu(int n)
{
	int i;
	float l=sqrt(n);
	for(i=2;i<=l;i++)
	{
		if(n%i==0)
		{break;}
	}
	if(i<=l)return(1);
	else return(0);
}
int huiwen(int n)
{
	int m=0,q=0,k=0;
	m=n;
	while(m!=0)
	{
		q=m%10;
		k=k*10+q;
		m=m/10;
	}
	if(n==k)
		return(0);
	else return(1);
}

void main()
{
	int m,n,i;
	scanf("%d%d",&m,&n);
	i=m;
	while((sushu(i)==1||huiwen(i)==1)&&i<=n)
		i++;
	if(i>n)
		printf("no");
	else
	{
		printf("%d",i);
		for(i++;i<=n;i++)
			if(sushu(i)==0&&huiwen(i)==0)
				printf(",%d",i);
	}
}


int sushu(int x)
{
    int i=2;
    int s=0;
    while (i<x)
    {
         if  ((x%i)==0)
         {
             s++;
             x=x/i;
         }
         else
         i++;
    }

    if  (s==0)
    return 1;
    else
    return 0;
}

int huiwenshu(int x)
{
    int y=0;
    int w;
    int ori;
    ori=x;

    while  (x>0)
    {
           w=x%10;
           y=y*10+w;
           x=(x-w)/10;
    }
    if  (ori==y)
    return 1;
    else
    return 0;
}

main()
{
      int m,n;
      int s=0;

      scanf("%d%d",&m,&n);
      while  (m<=n)
      {
           if  (sushu(m))
           {
               if  (huiwenshu(m))
               {
                   if (s==0)
                   {printf("%d",m);s++;}
                   else
                   printf(",%d",m);
               }
           }
           m++;
      }

      if  (s==0)
      printf("no");

}


int huiwen(int n)
{
	int b=0,m=n;
	while(n)
	{	b=b*10+n%10;
	   n/=10;
    }
	if(b==m)
		return 1;
	else
		return 0;
}
int sushu(int n)
{
	int i;
	if(n==2)
		return 1;
	else
		for(i=2;i<n;i++)
			if(n%i==0)
				break;
	 if(i==n)
		 return 1;
	 else
		 return 0;

}
int main()
{
	int i,m,n,t=0;
	scanf("%d %d",&m,&n);

	for(i=m;i<=n;i++)
		if(sushu(i)&&huiwen(i))
		{
			printf("%d",i);
			t++;
			break;
		}
	for(i++;i<=n;i++)
		if(sushu(i)&&huiwen(i))
		{
			printf(",%d",i);
			t++;
		}
	if(t==0)
		printf("no\n");
}


void main()
{
	int sushu(long k);
	int hui(long j);
	long n,m,i,t=0;
	scanf("%ld%ld",&m,&n);
	for(i=m;i<=n;i++)
	{if(sushu(i)==1&&hui(i)==1)
	{ t++;
	if(t==1) printf("%ld",i);
	else if(t>1) printf(",%ld",i);
	}
	}
	if(t==0) printf("no\n");
}

int sushu(long k)
{ long x;
 for(x=2;x<k/2;x++)
 { if(k%x==0){ return(0); break;}}
 if(x==k/2)  return(1);
}

int hui(long j)
{long p=0,temp,a;
temp=j;
while(temp>0)
{a=temp%10;
p=p*10+a;
temp/=10;
}
if(p==j) return(1);
else return(0);
}


int huiwen(int x,int y);
int sushu(int x);
void main()
{
 int m,n,i,j,k=0,temp,b[10000],t;
 scanf("%d%d",&m,&n);
 for(i=m;i<=n;i++)
 {
	 if((i==huiwen(i,0))&&(sushu(i)==1))
	 {b[k]=i;k=k+1;}
 }

 for(i=0;i<k;i++)
 {
	 t=i;
     for(j=i+1;j<k;j++)
		 if(b[j]<b[t])
			 t=j;
	 if(t!=i)
		 {
		   temp=b[i];
		   b[i]=b[t];
		   b[t]=temp;
		  }
 }
if(b[0]==0)printf("no");
else
 {
 printf("%d",b[0]);

 for(i=1;i<k;i++)
	 printf(",%d",b[i]);
}
}
int huiwen (int x,int y)
{
	if(x==0)return (y);
	else return(huiwen(x/10,y*10+x%10));
}
int sushu(int x)
{
	int j ;
	for(j=2;j<=x;j++)
		if(x%j==0)
			if(j!=x){ return(0);break;}
			else { return(1);}
}


int z(int i);
int h(int i);

main()
{
	int m,n,i,r,t;

	scanf("%d%d",&m,&n);

	r=0;

	for (i=m;i<=n;i++)
	   if (z(i)==1 && h(i)==1)
	   {printf("%d",i);r=1;break;}

	for (t=i+1;t<=n;t++)
		if (z(t)==1 && h(t)==1)
			printf(",%d",t);

	if (r==0)
	printf("no");
}

int z(int i)
{
	int r;
	for (r=2;r<=sqrt(i);r++)
		if (i%r==0)
			break;
     if (r<=sqrt(i)) return 0;
	 else return 1;
}

int h(int i)
{
	int y=0,k;
	k=i;
	while (i!=0)
	{
        y=10*y+i%10;
		i=i/10;
	}

	if (y==k) return 1;
	else return 0;
}


int CF(int n)
{
    int i,a=1;
    for(i=1;i<=n;i++)
    a=a*10;
    return a;
}
int SS(int n)
{
    int i,a;
    if(n==2)
    a=1;
    else
    for(i=2;i<n;i++)
    {
                    if(n%i==0)
                    {
                              a=0;
                              break;
                    }
                    else
                    a=1;
    }
    return a;
}
int HW(int n)
{
    int i,j,k,l,a,b=0,c;
    a=n;
    c=n;
    for(i=0;a>0;i++)
    {
                 a=a/10;
    }
    for(j=1;j<=i;j++)
    {
                 k=c/CF(i-j);
                 b=b+k*CF(j-1);
                 c=c-k*CF(i-j);
    }
    if(n==b)
    return 1;
    else
    return 0;
}
main()
{
      int m,n,i,j=0,k;
      scanf("%d %d",&m,&n);
      for(i=m;i<=n;i++)
      if(SS(i)==1&&HW(i)==1)
      {
                             if(j==0)
                             printf("%d",i);
                             else
                             printf(",%d",i);
                             j++;
      }
      if(j==0)
      printf("no");
      getchar();
      getchar();
}


int sushu(int x)
{
	int ia,mk;
	mk=1;
	for(ia=2;ia<=x/2;ia++)
	{
		if(x%ia==0)
		{mk=0;break;}
	}
	return(mk);
}
int huiwen(int y)
{
	int a[100],n,m,z,i,b;
	n=1;m=0;i=1;
	while(n<=y)
	{n=10*n;m++;}
	for(i=1;i<=m;i++)
	{
		b=pow(10,m-i);
		a[i]=y/b;
		y=y%(int)pow(10,m-i);
	}
	z=1;
    for(i=1;i<=m;i++)
	if(a[i]!=a[m+1-i])
	{z=0;break;}
	return(z);
}
void main()
{
	int ma,na,j,t;
	scanf("%d%d",&ma,&na);
    t=0;
	for(j=ma;j<=na;j++)
	{
		if(sushu(j)==1&&huiwen(j)==1)
		{
			if(t>0)printf(",");
				printf("%d",j);
				t++;
		}
	}
	if(t==0)printf("no");
}


  void main ()
{
     int aim[100];
     int m,n,a,b,c,k,i,p,t,num;

     num=0;
     scanf("%d %d",&m,&n);
    for (k=m;k<=n;k++)
   {
      p=0;
      t=k/2;
      for (i=2;i<=t;i++)
       {
          if (k%i==0)
		  {
			  p=1;
			  break;
		  }

       }
      if (p==0)
      {
		  b=0;
		  c=k;
       while(c!=0)
	   {
		   a=c%10;
		   b=b*10+a;
		   c=c/10;
	   }
	   if (b==k)
	   {
		   num=num+1;
		   aim[num]=k;
	   }
       else  continue;
	}
	  else continue ;
	}
if ( num!=0 )
{
 for (i=1;i<num;i++)
    {
     printf ("%d,",aim[i]);
     }
     printf("%d",aim[num]);
 }
else printf ("no");
}


void main()
{
	int huiwen(int);
	int sushu(int);
	int n,m,i,k=0;
	int a[300];
	int flag=0,temp=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		flag=huiwen(i);
		if(flag==1)
		{
			flag=sushu(i);
			if(flag==1)
			{
               a[k]=i;
			   k=k+1;
			   temp=1;
			}
		}
	}
	if(temp==0)
		printf("no");
	else
	{
		for(i=0;i<k-1;i++)
			printf("%d,",a[i]);
		printf("%d",a[k-1]);
	}
}
int huiwen(int a)
{
	int temp=0;
	int x=0,b,i,t;
	if(a/10==0)
		temp=1;
	else
	{   t=a;
		for(i=0;a!=0;i++)
		{
			b=a%10;
			x=10*x+b;
			a=a/10;
		}
		if(x==t)
			temp=1;
	}
	return(temp);
}
int sushu(int a)
{
	int i;
	int temp=1;
	for(i=2;i<a/2;i++)
	{
		if(a%i==0)
		{
			temp=0;
			break;
		}

	}
	return(temp);
}


int fs(int m){
    int i;
    if(m==1||m==2) {
        return 0;
    }
    else{
    for(i=2;i<m;i++){
        if(m%i==0)
        break;
        }
    if(i<m) return 0;
    else return 1;
    }
        }
int fh(int n){
    int a=n/10;
    int b=n%10;
    int m=0;
    int t;
    while(a!=0){
     m=b*10;
     t=a;
     a=a/10;
     b=t%10;
    b+=m;
    }
    if(b==n) return 1;
    else return 0;
    }
int main()
{
    int k1,k2,i;
    int count=0,ncount=0;
    scanf("%d%d",&k1,&k2);
    for(i=k1;i<=k2;i++){
        if(fs(i)==1&&fh(i)==1&&count==0){
        printf("%d",i);
        count++;
        ncount++;
        }
        else if(fs(i)==1&&fh(i)==1&&count!=0){
            printf(",%d",i);
            count++;
            ncount++;
            }
        }
        if(ncount==0)printf("no\n");
        return 0;

    }


int judge1(int x)
{
	if(x==1)
		return 0;
	else
	{
		int w=1,k=2;
		while(k*k<=x)
		{
			if(x%k==0)
			{
				w=0;
				break;
			}

			k++;
		}

		return w;
	}
}

int judge2(int x)
{
	int x1=x,y=0;
	while(x1>0)
	{
		y=y*10+x1%10;
		x1/=10;
	}

	if(x==y)
		return 1;
	else
		return 0;
}

void main(void)
{
	int m,n;
	scanf("%d%d",&m,&n);

	int k,t=0;
	for(k=m;k<=n;k++)
		if(judge1(k)&&judge2(k))
		{
			if(t)
				printf(",");

			printf("%d",k);

			t++;
		}

	if(!t)
		printf("no");

	printf("\n");
}


// ??????.cpp : Defines the entry point for the console application.
//

int isround(int num)
{
	int temp,mid;
	temp = 0;
  mid = num;
  while (mid != 0)
  {
   temp = temp*10 + mid%10;
   mid /= 10;
  }
	if(temp==num)return 1;
	else return 0;

}

int isprime(int n)
{
	int i;
	int count=0;
	for(i=2;i<=n-1;i++)
	{
		if(n%i==0)count++;
	}
	if(count==0)return 1;
	else return 0;

}

int main()
{
	int m,n;
	int i;
	int count=0;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(isprime(i)==1&&isround(i)==1)
		{
			if(count==0)
				printf("%d",i);
			else
				printf(",%d",i);
			count++;
		}
	}
     if(count==0)printf("no");

	return 0;
}


int sushu(int p,int n)
{
	if(p>n/2)
	{
		return 1;
	}
	else if(n%p==0)
	{
		return 0;
	}
	else
	{
		return sushu(p+1,n);
	}
}
int huiwen(int n)
{
	int a[100],flag,i;
	for(i=0;n!=0;i++)
	{
		a[i]=n%10;
		n=n/10;
		flag=i;
	}
	for(i=0;i<=flag;i++)
	{
		if(a[i]!=a[flag-i])
		{
			return 0;
		}
	}
	return 1;
}

int main()
{
	int a,b,i,flag=0;
	scanf("%d %d",&a,&b);
	for(i=a;i<=b;i++)
	{
		if(huiwen(i)==1&&sushu(2,i)==1&&flag==0)
		{
			printf("%d",i);
			flag=1;
		}
		else if((huiwen(i)==1)&&(sushu(2,i)==1)&&(flag==1))
		{
			printf(",%d",i);
		}
	}
	if(flag==0)
	{
		printf("no");
	}
	return 0;
}


int zh(int x);
int h(int x);
void main()
{
	int m,n,i,d=0,a[1000];
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(h(i)&&zh(i))
		{
			a[d]=i;
			d++;
		}
	}
	if(d==0) printf("no\n");
	else
	{
		for(i=0;i<d-1;i++)
			printf("%d,",a[i]);
		printf("%d\n",a[d-1]);
	}
}
int zh(int x)
{
	int i=0;
	for(i=2;i<=sqrt(x);i++)
		if(x%i==0)
			break;
	if(i>sqrt(x))
		return(1);
	else return(0);
}
int h(int x)
{
	int m=0,n=x;
	while(n>0)
	{
		m=m*10+n%10;
		n/=10;
	}
	if(x==m)
		return(1);
	else return(0);
}


int Test1(int n)
{
	int d=0,
	m=n;
	while (m)
	{
		d=d*10+m %10;
		m/=10;
	}
	return d ==n;
}
int Test2(int n)
{
int m = (int)sqrt(n);
int i;
for(i=2;i<=m;i++)
if(n%i==0)
break;
if(i==m+1)
return 1;
else
return 0;
}
main()
{
int n,m;
int nCount = 0;
scanf("%d %d",&n,&m);
for(int i=n;i<=m;i++)
{
if(Test1(i)&&Test2(i))
{
if(nCount==0)
printf("%d",i);
else
printf(",%d",i);
nCount ++;
}
}
if(nCount == 0)
printf("no");
printf("\n");

}


int tp(int x)
{
 int i,k;
 k=sqrt(x);
 for(i=2;i<=k;i++)
 {
                 if(x%i==0) break;
                 }
 if(i==k+1)
 return 1;
 else return 0;
}

int th(int x)
{
  int a,b,c;
  b=0;
  c=x;
  while(x!=0)
  {
             a=x%10;
             b=b*10+a;
             x=x/10;
             }
  if(c==b) return 1;
  else return 0;
}

main()
{
      int m,n;
      scanf("%d %d",&m,&n);
      int i,t=0;
      for(i=m;i<=n;i++)
      {
                          if(tp(i)==1 && th(i)==1)
                          {
                                      if(t==0)
                                      {
                                              printf("%d",i);
                                              t++;
                                              }
                                      else
                                      printf(",%d",i);
                                      }
                          }
      if(t==0)
      printf("no");
      getchar();
      getchar();
      }