semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
 * ????.cpp
 *
 *  Created on: 2011-1-4
 *      Author: wangwei
 */
int main()
{
	int i,j,a[6][6],m[6],t1=0,t2;
	for(i=1;i<=5;i++)
		for(j=1;j<=5;j++)
			cin>>a[i][j];
	for(i=1;i<=5;i++)
		m[i]=1;
	for(i=1;i<=5;i++)
	{
		for(j=1;j<=4;j++)
			if(a[i][j+1]>a[i][m[i]])
				m[i]=j+1;
		t2=0;
		for(j=1;j<=5;j++)
			if(a[j][m[i]]<a[i][m[i]])
				t2=1;
		if(t2==0)
		{
			cout<<i<<' '<<m[i]<<' '<<a[i][m[i]]<<endl;
			t1++;
		}
	}
	if(t1==0) cout<<"not found"<<endl;
	return 0;
}
int main()
{
	int a[5][5];
	int rmax[5] = {0}, cmin[5] = {0};
	int i, j;
	int rmaxno[5], cminno[5];
	int f = 0;

	for (i = 0; i <= 4; i++)
		for(j = 0; j <= 4; j ++)
			cin >> a[i][j]; 
	
	for(i = 0; i <= 4; i++)                //????????????
	{
		rmax[i] = a[i][0];
		rmaxno[i] = 0;
		for(j = 0; j <= 4; j++)
		{
			if (rmax[i] < a[i][j])
			{
				rmax[i] = a[i][j];
				rmaxno[i] = j;

			}
		}
	}

	for(j = 0; j <= 4; j++)
	{
		cmin[j] = a[0][j];
		cminno[j] = 0;
		for(i = 0; i <= 4; i++)
		{
			if(cmin[j] >= a[i][j])
			{
				cmin[j] = a[i][j];
				cminno[j] = i;
			}
		}
	}
	

	for(i = 0; i <= 4; i ++)
	{
		if(cminno[rmaxno[i]] == i)
		{
			f = 1;
			cout << i + 1 << " " << rmaxno[i] + 1 << " " << rmax[i] << endl;
		}
	}

	if(f == 0)
	cout << "not found";
	
	
	return 0;

		
}
//********************************
//*???????      **
//*?????? 1300012887 **
//*???2013.11.03 **
//********************************
int main()
{
	int a[6][6],i, j, k, l = 0, b, max;
	for (i = 0; i <= 4; i++)
		for (j = 0; j <= 4; j++)
			cin >> a[i][j];    //????
    for (k = 0; k <= 4; k++)    //????????????
	{
		max = a[k][0];
		b=0;
		for (j = 1; j <= 4; j++)
		{
			if (a[k][j] > max)
			{
				max = a[k][j];//?????????
			    b = j;    //?????????
			}
		}
		if (max <= a[0][b] && max <= a[1][b] && max <= a[2][b] && max <= a[3][b] && max <= a[4][b])
		{
			cout <<  k+1 << " " << b+1 << " " << max << endl;   //????????
			l++;    //???????
		}
	}
	if (l == 0)
		cout << "not found" << endl;
	return 0;
}
int findmax(int *p)
{	int i,t=0;
	for(i=0;i<5;i++)
	{
		if(*(p+t)<*(p+i))t=i;
	}
	return (t);	
}
int dmin(int a[5][5],int c,int r)
{	int i;
	for(i=0;i<5;i++)
	{
		if(a[i][c]<a[r][c])return 0;
	}
	return 1;
}
void main()
{
	int i,j,a[5][5],b[5],k=0;
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for(i=0;i<5;i++)
	{
		if(dmin(a,b[i]=findmax(a[i]),i)){printf("%d %d %d",i+1,b[i]+1,a[i][b[i]]);k++;}
	}
			
	if(k==0) printf("not found");
}
int main()
{
    long int a[7][7];
    long int i,j,x=0,y=0,m,k;
    for (i=0;i<5;i++)
       for (j=0;j<5;j++) 
          cin>>a[i][j];
    for (i=0;i<5;i++)
        {
         x=i;y=0;m=a[i][0];
         for (j=1;j<5;j++)
            {
            if (m<a[i][j])
               {
               m=a[i][j];
               x=i;
               y=j;
               }
            
            }
         for (k=0;k<5;k++)
                 {
                 if (m>a[k][y])
                   break;
                 }
              if (k==5)
                    {
                    cout<<x+1<<" "<<y+1<<" "<<m;
                    i=5;j=5;
                    m=0;
                    }
    }
    if (m)
       cout<<"not found";
    return 0;
}
int main()
{ 
 int a[6][6],i,j,max,h,flag;
 for (i = 1; i < 6; i++)
	 for (j = 1; j < 6; j++)
		 cin >> a[i][j];
 h = 0;
 flag = 0;
 for (i = 1; i < 6; i++)
 {   
	 max = a[i][1];
	 for (j = 1; j < 6; j++)
	 {	
		 if (a[i][j] >= max) 
		 {
			 max = a[i][j]; h = j;
		 }
	 }
	if (a[i][h] <= a[5][h] && a[i][h] <= a[1][h] && a[i][h] <= a[2][h] && a[i][h] <= a[3][h] && a[i][h] <= a[4][h]) 
		 {
	        	flag = 1;
			    cout << i << " " << h << " " << a[i][h] << endl;
		}
 }
 if (flag == 0) cout << "not found";
 return 0;
}
int main(){
	int a[5][5];
	int b[5];
	int c[5];
	int b1[5];
	int c1[5];
	int a1[5],a2[5];
	int i=0,j=0,k=0,p=0,m=0,n=0;
	int max,min;
	int 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=a[i][0];b[k]=i;c[k]=0;
		for(j=0;j<5;j++){
			if(a[i][j]>max){
				max=a[i][j];
				b[k]=i;c[k]=j;
			}
		}a1[k]=max;k++;max=0;}
	for(m=0;m<5;m++){
		min=a[0][m];b1[p]=0;c1[p]=m;
		for(n=0;n<5;n++){
			if(a[n][m]<min){
				min=a[n][m];
				b1[p]=n;c1[p]=m;
			}
		}a2[p]=min;p++;min=0;
	}
	for(i=0;i<5;i++)
		for(j=0;j<5;j++){
			if(a1[j]==a2[i]&&b[j]==b1[i]&&c[j]==c1[i]){
				cout<<b[j]+1<<' '<<c[j]+1<<' '<<a1[j]<<endl;
			}
			else {
				count++;
			}
		}
	if(count==25)
		cout<<"not found"<<endl;
	return 0;
}
//
//  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 main()
{
	int a[6][6],i,j,max[6]={0,0,0,0,0,0},min[6]={0},h[6],l[6];//??????a?6??6??????????max???min??????????????????hl???????????????????????
	for(i=1;i<=5;i++)//???h?i????-1
	{
		h[i]=1;
		l[i]=1;
	}
	for(i=1;i<=5;i++)//??????
	{
		for(j=1;j<=5;j++)
		cin>>a[i][j];
	}
	for(i=1;i<=5;i++)//????????????????
		min[i]=a[1][i];
	for(i=1;i<=5;i++)//????????????????????????
	{
		for(j=1;j<=5;j++)
		{
			if(a[i][j]>max[i])
			{
				max[i]=a[i][j];
				h[i]=j;
			}
			if(a[j][i]<min[i])
			{
				min[i]=a[j][i];
				l[i]=j;
			}
		}
	}
	int x,y,m=0;
	for(i=1;i<=5;i++)//???????
		for(j=1;j<=5;j++)
		{
			if(h[i]==j&&l[j]==i)
			{
				x=i;
				y=j;
				m=m+1;
			}
		}
	if(m==0)//?????
		cout<<"not found"<<endl;
	else
		cout<<x<<" "<<y<<" "<<max[x]<<endl;
	return 0;
}
int main()
{
	int a[5][5], m, i, j, p = 0, k, q = 0;
	for( i = 0; i < 5; i++ )
		for( j = 0; j < 5;j++ )
			cin >> a[i][j];
		for( i = 0; i < 5; i++ )
		{
			m = 0;
			for( j = 0; j < 5;j++ )
			{
				if( a[i][j] > m )
				{
					m = a[i][j];
					p = j;                    // ???????
				}
			}
				for( k = 0;k < 5;k++)
					if( a[k][p] < a[i][p] )
						break;               // ???????????
					if( k == 5 ) 
					{
						cout << i+1 << " " << p+1 << " " << a[i][p] << endl;      // k=5???
						q = 1;                     // ??????1
					}
		}
		if(q == 0)
			cout << "not found" << endl;          // ???????not found
	return 0;
}
int main()
{   
	int * p[5],* q[5];
	int a[5][5],* point;
	point = * a;
    
	int i,j;
	for(i=0;i<25;i++)
	{
			cin >> *point;
			point++;
	}

	for( i=0;i<5;i++)
	{
		* (p+i) = * ( a+i );
		for( j=0,point=*(a+i) ;j<5; point++,j++ )
		{
			if( *point > **( p+i) )
				* (p+i) = point;
		}
	}

	int flag =0;
	for( i=0;i<5;i++ )
	{   
		int t=0;
		* (q+i) = (*a) +i;
		for( j=0,point=*(q+i); j<5 ;j++,point+=5)
		{
			if( *point < **(q + i) )
			{
				* (q+i ) = point;
				t=j;
			}
		}
		if( *(q+i) == * (p+t) )
		{
				cout << t+1 << ' '<< i+1 << ' ' << **(q+i) << endl;
				flag=1;
		}
	}

	if( flag ==0 )
		cout << "not found" << endl;
	return 0;
}
//*******************************************************
//*10.26??  ????                                  *
//*?????  ?? 1100012844                          *
//*???2011?10?26?                                 *
//*******************************************************
int main()
{
	// ??????,????a[1][1]?a[5][5]
	int a[6][6], i, j, row, colum, k, max, flag = 1, m, n;

	// ????
	for (i = 1; i <= 5; i++)
		for (j = 1; j <= 5; j++)
			cin >> a[i][j];

	// ????????i?????max,????row???colum ???max???
	// colum??????,?????
	for (i = 1; i <= 5; i++)
	{
		max = a[i][1]; // ????i???1?????
		n = 1; 
		for (j = 1; j <= 5; j++)
		{

			// ??i????max???????max
			if (a[i][j] > max)
			{
				max = a[i][j];
				row = i;
				colum = j;
				n = 0; // n=0??max????
			}
		}

		// ??max?????row=i,colum=1
		if (n)
		{
			row = i;
			colum = 1;
		}

		// ???max?colum??????
		m = 1;
		for	(k = 1; k <= 5; k++)
		{
			if (max > a[k][colum])
				m = 0; // ??max???????m??0
		}

		// m=1?(max?colum????)???
		if (m)
		{
			cout << row << " " << colum << " " << max;
			flag = 0;
		}
	}

	// ?????????flag??0,?????flag??1
	if (flag)
		cout << "not found";
	return 0;
}
int main()
{
	int i,j,k;
	int a[5][5];
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	k=0;
    for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			if(a[i][j]>=a[i][(j+1)%5]&&a[i][j]>=a[i][(j+2)%5]&&a[i][j]>=a[i][(j+3)%5]&&a[i][j]>=a[i][(j+4)%5]&&a[i][j]<=a[(i+1)%5][j]&&a[i][j]<=a[(i+2)%5][j]&&a[i][j]<=a[(i+3)%5][j]&&a[i][j]<=a[(i+4)%5][j])
			{
				printf("%d %d %d\n",i+1,j+1,a[i][j]);
				k=k+1;
			}
		}
	}
	if(k==0)
	{
		printf("not found");
	}
	return 0;
}
int main() {
	int map[6][6];
	int i,j,k;
	int g = 0;
	for(i=0; i<5; i++) {
		for(j=0; j<5; j++) {
			scanf("%d", &map[i][j]);
		}
	}
	for(i=0; i<5; i++) {
		k = 0;
		for(j=1; j<5; j++) {
			if(map[i][j] > map[i][k]) {
				k = j;
			}
		}
		for(j=0; j<5; j++) {
			if(j!=i && map[j][k]<map[i][k]) {
				break;
			}
		}
		if(j >= 5) {
			printf("%d %d %d\n", i+1, k+1, map[i][k]);
			g = 1;
		}
	}
	if(g == 0) {
		printf("not found\n");
	}
	return 0;
}
int main()
{
    int a[5][5],b[5][5];
    int i,j,max,min,flag;
    flag=0;
    for(i=0;i<5;i++)//row
    {
                    for(j=0;j<5;j++)//line
                    {
                                    scanf("%d",&a[i][j]);
                                    b[i][j]=0;
                    }
    }
    for(i=0;i<5;i++)
    {
                    max=a[i][0];
                    for(j=0;j<5;j++)if(max<a[i][j])max=a[i][j];
                    for(j=0;j<5;j++)if(a[i][j]==max)b[i][j]=1;
    }
    for(j=0;j<5;j++)
    {
                    min=a[0][j];
                    for(i=0;i<5;i++)if(min>a[i][j])min=a[i][j];
                    for(i=0;i<5;i++)if(a[i][j]==min)b[i][j]=b[i][j]+1;
    }
    for(i=0;i<5;i++)//row
    {
                    for(j=0;j<5;j++)//line
                    {
                                          //printf("%d ",b[i][j]);
                                          if(b[i][j]==2)
                                          {
                                                        printf("%d %d %d",i+1,j+1,a[i][j]);flag=1;
                                          }
                    }
                    printf("\n");
    }
    if(!flag)printf("not found");
    return 0;
}
int main()
{
	int a[5][5],i,j,flag[5],max,maxj;
	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);
		maxj=0;
		for(j=1;j<5;j++)
		{
			if(*(*(a+i)+j)>max)
			{
				max=*(*(a+i)+j);
				maxj=j;
			}
		}
		if(*(*(a+0)+maxj)>=max&&*(*(a+1)+maxj)>=max&&*(*(a+2)+maxj)>=max&&*(*(a+3)+maxj)>=max&&*(*(a+4)+maxj)>=max)
		{
			cout<<i+1<<' '<<maxj+1<<' '<<max<<endl;
		}
		else
		{
			*(flag+i)=0;
		}
	}
	if(*(flag+0)==0&&*(flag+1)==0&&*(flag+2)==0&&*(flag+3)==0&&*(flag+4)==0)
	{
		cout<<"not found"<<endl;
	}
	return 0;
}
void main()
{
int a[5][5],i,j,k,l=0,t=0;
int (*p)[5];
p=a;
for(i=0;i<5;i++)
for(j=0;j<5;j++)
scanf("%d",(*(p+i)+j));
for(i=0;i<5;i++)
{for(j=0;j<5;j++)
{t=0;
for(k=0;k<5;k++)
{if(a[i][j]<a[i][k])
t--;}
for(k=0;k<5;k++)
{if(a[i][j]>a[k][j])
t--;}
if(t==0)
{printf("%d %d %d",i+1,j+1,a[i][j]);
l--;}
}}
if(l==0)
printf("not found");
}
// andian
void main()
{
    int a[5][5];
    int j=0,i=0,k=0;
    while(j<5)
    {
        while(i<5)
        {
            scanf("%d",&a[j][i]);
            i++;
        }
        i=0;
        j++;
    }
    for (j=i=0; j<5; j++)
    {
        for(i=0;i<5;i++)
        {
            if(a[j][i]>=a[j][0]&&a[j][i]>=a[j][1]&&a[j][i]>=a[j][2]&&a[j][i]>=a[j][3]&&a[j][i]>=a[j][4])
            {
                if(a[j][i]<=a[0][i]&&a[j][i]<=a[1][i]&&a[j][i]<=a[3][i]&&a[j][i]<=a[4][i]&&a[j][i]<=a[2][i])
                {printf("%d %d %d",j+1,i+1,a[j][i]); k++;}
            }
        }
    }
    if(k==0)printf("not found");
}
int main()
{
	int i,j,k,a[5][5],b=0,c=0,d=0;
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{	scanf("%d",&a[i][j]);
		}
	}
	for(i=0;i<5;i++)
	{
		for(j=0;j<5;j++)
		{
			b=0;
			c=0;
			for(k=0;k<5;k++)
			{
				if(a[i][j]>a[i][k])
					b++;
				if(a[i][j]<a[k][j])
					c++;
			}
			if(b==4&&c==4)
			{
				printf("%d %d %d",i+1,j+1,a[i][j]);
				d++;
			}
		}
	}
	if(d==0)
		printf("not found");
	return 0;
}
int main()
{
	int a[5][5],line[5],row[5],i,j,max,min,loc,t=0;
	for (i=0;i<5;i++)
		for (j=0;j<5;j++)
			scanf("%d",&a[i][j]);
	for (i=0;i<5;i++)
	{
		max=0;
		min=1000000;
		for (j=0;j<5;j++)
			if (a[i][j]>max)
			{
				max=a[i][j];
				loc=j;
			}
		line[i]=loc;
		for (j=0;j<5;j++)
			if (a[j][i]<min)
			{
				min=a[j][i];
				loc=j;
			}
		row[i]=loc;
	}
	for (i=0;i<5;i++)
		if (row[line[i]]==i)
			printf("%d %d %d\n",i+1,line[i]+1,a[i][line[i]]);
		else t++;
	if (t==5) 
		printf("not found\n");
	return 0;
}
int main()
{
	int sz[5][5];
	int i,k;
	int t,a,b,m,n,p,q=0;
	for(i=0;i<5;i++)
	{
		for(k=0;k<5;k++)
		{
		    scanf("%d",&sz[i][k]);
		}
	}
	for(m=0;m<5;m++)
	{
		p=0;
		t=-100;
		for(n=0;n<5;n++)
		{
			if(sz[m][n]>t)
			{
				t=sz[m][n];
				a=m;
				b=n;
			}
		}
		for(i=0;i<5;i++)
		{
			if(sz[i][b]>=sz[a][b])
			{
				p++;
			}
		}
		if(p==5)
		{
			printf("%d %d %d",a+1,b+1,sz[a][b]);
		}
		else
		{
			q++;
		}
	}
	if(q==5){
		printf("not found");
	}
	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 huiwen(int x);
  int sushu(int x);
  int m,n,x,p,q,i,j,c[1000];
  scanf("%d %d",&m,&n);
  i=0;
  for (x=m;x<=n;x++)
  {
    p=huiwen(x);
    q=sushu(x);
    if (p==1&&q==1)
    {
      c[i]=x;
      i++;
    }
  }
  if (i==0)
    printf("no\n");
  else
  {
    for (j=0;j<i;j++)
    {
      if (j!=i-1)
        printf("%d,",c[j]);
      else
        printf("%d\n",c[j]);
    }
  }
}
int huiwen(int x)
{
  int s,t,k,a[10],b[10],y;
  for (s=0;x!=0;s++)
  {
    a[s]=x;
    x=(int)(x/10);
  }
  a[s]=0;
  for (t=0;t<s;t++)
  {
    b[t]=a[t]-a[t+1]*10;
  }
  y=0;
  for (t=0;t<s;t++)
  {
    if (b[t]==b[s-1-t])
      y++;
  }
  if (y==s)
    return(1);
  else
    return(0);
}
int sushu(int x)
{
  int u,v;
  v=0;
  for (u=1;u<=x;u++)
  {
    if (x%u==0)
      v++;
  }
  if (v==2)
    return(1);
  else
    return(0);
}
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 judge(int n)
{
	int a=1,i;
	for(i=2;i<=sqrt(n);i++)
    if(n%i==0)
		a=0;
    return (a);
}
int main()
{
	int n,m,i,t,j,s=0,k,b[100],l=0,p;
    scanf("%d %d",&n,&m);
    for(i=n;i<=m;i++)
    {
		k=i;
		if(judge(k)==1)
		{
			t=i;
			j=0;
			while(t>0)
			{
				j=j*10+t%10;
				t/=10;
			}
			if(j==i)
			{
				s=1;
				b[l]=i;
				l++;
				p=l;
			}
		}
	}
	if(s==1)
	{
		for(l=0;l<p-1;l++)
			printf("%d,",b[l]);
		printf("%d\n",b[l]);
	}
	if(s==0) printf("no\n");
	return 0;
}
int dudu(int x)
{
	int i,j;
	j=sqrt(x);
	(int) j;
	for (i=3;i<=(j+1);i++)
	{if(x%i==0) break;}
	if (i==(j+2)) return (1);
	else return (0);
}
int jay(int x)
{
	int a,i=0,j,n,b[1000];
	for (a=10;(x*10-a)>=0;a=(a*10)) 
	{
		b[i]=x%a;
		x=(x-b[i]);
		b[i]=b[i]*10/a;
		i++;
	}
	i--;
	if (i%2) n=(i-1)/2;
	else n=i/2;
	for (j=0;j<=n;j++)
		if (b[i-j]!=b[j]) break;
	if (j==(n+1)) return (1);
	else return (0);
}
void main()
{
	int m,n,i=0,j,p,a[300];
	scanf("%d %d",&m,&n);
	if (m%2==0) m++;
	if (n%2==0) n--;
	for (p=m;p<=n;p=p+2)
		if (jay(p))
			if (dudu(p))
			{a[i]=p;i++;}
	if (i==0) printf("no");
	else for(j=0;j<i;j++) 
	{if (j==i-1) printf("%d",a[j]);
	else printf("%d,",a[j]);}
}
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 pan1(int a)
{
	int b=0,c=a;

	while(c!=0)
	{
		b=10*b+c%10;
		c=c/10;
	}
	if(a==b) return 1;
	else return 0;
}
int pan2(int a)
{
	int i,y=1;
	for(i=2;i<=sqrt(a);i++) if(a%i==0) y=0;
	return(y);
}
void main()
{
	int a,b,c[100]={0},i,j=0;
	scanf("%d %d",&a,&b);
	for(i=a;i<=b;i++)
	{
		if(pan1(i)&&pan2(i)) {c[j]=i;j=j+1;}
	}
	if(c[0]){for(i=0;i<j-1;i++) printf("%d,",c[i]);
	printf("%d\n",c[j-1]);}
else printf("no");
}
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 main()
{
	int i,m,n,j,k,a,b,p=0,s;
	int t[1000];
    scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
	{
		k=(int)sqrt(i);
		
		for(j=2;j<=k;j++)
		{
			if(i%j==0)
			break;
		}
		   
		if(j>k)
		{
			 a=0;
             b=i;
             while(b!=0)
			{
				 a=a*10+b%10;
				 b=b/10;
			 }
             if(a==i)
			 {
				 t[p]=i;
                 p++;
			 }
		}
	 } 
	if(p==0)
	{
	 printf("no");
	}
	else
	{
		for(s=0;s<p-1;s++)
		{
			
	         printf("%d,",t[s]);
		}	
	         printf("%d",t[p-1]);
			
		
	}
return 0;
}
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);
}