semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
main()
{
	int m,n,temp,k,l,p,i,j,s,r,num;
	scanf("%d%d",&m,&n);
	s=0;
	for(i=m;i<=n;i++)
	{ 
	   
	   k=sqrt(i);
	   for(j=2;j<i;j++)
		   if(i%j==0) break;
		   if(j>k) 
		   {
		       num=0; 
               j=i; 
          while(j!=0) 
		  { 
          num=num*10+j%10; 
            j/=10; 
		  } 
           if(num==i) 
		   {  s++;
		   printf("%d",num);break;}
		   }

	}
	
	for(i=i+1;i<=n;i++)
	{ 
	   
	   k=sqrt(i);
	   for(j=2;j<i;j++)
		  if(i%j==0) break;
		  if(j>k) 
		  {
		       num=0; 
               j=i; 
             while(j!=0) 
			 { 
            num=num*10+j%10; 
            j/=10; 
			 } 
           if(num==i) 
		   {s++;
		   printf(",%d",num);}

		  }
 
    }


	if(s==0) printf("no");
}
int isprime(int n)
{
    int i;
    for (i = 2; i < n; i++)
    {
        if (n % i == 0)
            return 0;
    }
    return 1;
}

int ishuiwen(int n)
{
    int i, len;
    char a[11];
    sprintf(a, "%d", n);
    len = strlen(a);
    for (i = 0; i < len/2; i++)
    {
        if (a[i] != a[len-i-1])
            return 0;
    }
    return 1;
}

int main()
{
    int ishuiwen(int);
    int isprime(int);
    int count = 0, i, m, n;
    scanf("%d%d", &m, &n);
    for (i=m; i<=n; i++)
    {
        if (isprime(i) && ishuiwen(i))
        {
            count++;
            if (count == 1)
                printf("%d", i);
            else
                printf(",%d",i);
        }
    }
    if (count == 0)
        printf("no");
    return 0;
}
int su(int m)
{
	int p,i;
	if(m==2)
	{
		p=1;
	}
	else if (m==1)
	{
		p=0;
	}
	else
	{
		for(i=2;i<m;i++)
		{
			if(m%i==0) 
			{
				p=0;
				break;
			}
		}
		if(i==m)
		{
			p=1;
		}
	}
	return (p);
}
int hui(int m)
{
	int i=m,j=0,p;
	while(m>0)
	{
		j=j*10+m%10;
		m/=10;
	}
	if(i==j) 
	{
		p=1;
	}
	else
	{
		p=0;
	}
	return(p);
}
int main()
{
	int m,n,count=0;
	scanf("%d%d",&m,&n);
	while(m<=n)
	{
		if(su(m)&&hui(m))//????1????????
		{
			if(count==0)
			{
				printf("%d",m);
				count=1;
			}
			else
			{
				printf(",%d",m);
			}
		}
		m++;
		
	}
	if(count==0)
	{
		printf("no");
	}
	return 0;
}
int sushu(int n)
{
	int i;
	for(i=2;i<n/2;i++)
	{
		if(n%i==0)
		{
			return 1;
			break;
		}
	}
	return 0;
}
int reverse(int n)
{
	int i,j;
	int a[10];
	int flag=0;
	int temp;
	temp=n;
	if(n/10==0)
	{
		return 0;
	}
	else if(n/100==0)
	{
		if(n%10==n/10)
		return 0;
		else
		return 1;
	}
	else
	{
	for(i=0;(n/10!=0||n%10!=0);i++)
	{
		a[i]=n%10;
		n=n/10;
	}
	for(j=i-1;j>=0;j--)
	{
		if(a[j]!=a[i-1-j])
		{
			flag=1;
			return 1;
		}
	}
	if(flag==0)
	{
		return 0;
	}
	}
}
void main()
{
	int m,n;
	int i,j;
	int flag=0;
	int flag1=0;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(sushu(i)==0)
		{
			if(reverse(i)==0)
			{
				flag1=1;
				if(flag==0)
				{
					flag=1;
					printf("%d",i);
				}
				else
				{
					printf(",%d",i);
				}
			}
		}
	}
	if(flag1==0)
	{
		printf("no");
	}
}
/*?? - ??????	
??	??-From Whf
??
??????? m ?n ??????????????????m ? n?????m ???n??????????????????????????? no (??????????????????123321?121)?
????
m ? n ?1??????1??????
????
?????????????????????????? no
????
100  200
????
101,131,151,181,191
*/
int huiwen(int x)
{
	int y=0;
	for(;x!=0;)
	{
		y=y*10+x%10;
		x=x/10;
	}
	return y;
}
int zhishu(int x)
{
	int i,k;
	k=x/2;
	for(i=2;x%i!=0&&i<k+1;i++);
	if(i==k+1) return 1;
	else return 0;
}
void main()
{
	int l=1,n,m,i;
	scanf("%d%d",&n,&m);
	for(i=n;i<=m;i++)
	{
		if(i==huiwen(i))
			if(zhishu(i))
			{
				if(l==1){printf("%d",i);l++;}
				else printf(",%d",i);
			}
	}
	if(l==1)
		printf("no");
}
void main()
{
	int m,n,i,j,k,l,a,sum,x,y,array[100],z;
	scanf("%d%d",&m,&n);
	for(i=m,y=0;i<=n;i++)
	{   
		for(j=2,k=0;j<i;j++)
			if(i%j==0)
				break;
			if(j==i)
				k=1;
			a=i;
		for(z=0,sum=0,l=0;a>=1;z++)
		{
			x=a%10;
			a=a/10;
		    sum=sum*10+x;
		}
		if(sum==i)l=1;
		if(l==1&&k==1)
		{
			array[y]=i;
			y++;
		}
	}
	if(y==0)printf("no");
	else
	{
		for(i=0;i<y-1;i++)
		printf("%d,",array[i]);
	printf("%d",array[i]);
	}
}
int main()
{
	int flag=0;
	int sushu(int);
	int huiwen(int);
	int m,n,i;
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++)
	{
		if(sushu(i)&&huiwen(i))
		{
		if(flag!=0)printf(",%d",i);
		else {printf("%d",i);flag=1;}	
		}
		
	}
	if(flag==0) printf("no");
	return 0;
	}
int sushu(int n)
{
	if(n==2) return 1;
	int j,k=sqrt(n);
	for(j=2;j<k+1;j++)
	{
		if(n%j==0) break;
	}
	if(j==k+1) return 1;
	else return 0;
}
int huiwen(int n)
{
     int j;
     if(n<10)
       return 1;
       int i=0,a[15];
          while(n)
        {a[i]=n%10;
     i++;
        n/=10;}
         i--;
       for(j=0;j<i;j++,i--)
       if(a[j]!=a[i])
      return 0;
         return 1;
}
int huiwen(int);

int zhishu(int);

int main(int argc, char* argv[])
{
	int m,n;
	scanf("%d%d",&m,&n);
	int i,first=1,flag=1;
	for(i=m;i<=n;i++)
	{
		if(huiwen(i)&&zhishu(i))
		{
			if(first)
			{
				printf("%d",i);
				first=0;
			}
			else
			{
				printf(",%d",i);
			}
			flag=0;
		}
	}
	if(flag)
	{
		printf("no");
	}
	
	return 0;
}

int zhishu(int n)
{
	int c;
	for(c=2;c<n;c++)
	{
		if(n%c==0)
		{
			return 0;
		}
	}
	return 1;
	}
		
int huiwen(int n)
{	
	int s=n,j=0;
	while(s>0)
	{
		j=j*10+s%10;
		s/=10;
	}
	if(n==j)
	{
		return 1;
	} 
	return 0;
}
int huiwen(int a)
{
	int i,j=0,flag=1,b[10];
	while(a!=0)
	{
		b[j]=a%10;
		a=a/10;
		j++;//??
	}
	for(i=0;i<j-i;i++)
	{
		if(b[i]!=b[j-i-1])
		{
			flag=0;
			break;
		}
	}

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

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

	return 0;
}
void main()
{
	int n, m, i, j, k, l, flag=0, c, sign=0, t, o, d, tip=0, h=0;
	scanf("%d %d", &m, &n);
	for(i=m;i<=n;i++){
		c=i;
		d=sqrt(i);
		for(j=2;j<=d;j++){
			if(i%j != 0){
				flag++;
			}
			else
				break;
		}
		if(flag == (d-1)){
			do
			{
				c/=10;
				sign++;
			}
			while(c != 0);
			for(k=1;k<=(sign/2);k++){
			    t=i;
			    o=i;
			    for(l=1;l<k;l++){
				    t/=10;					
				}			    
			    for(l=1;l<=(sign-k);l++){
				    o/=10;
				}
				if((t%10)==(o%10)){
					tip++;
				}
			}
			if(tip == (sign/2)){
				if(h==0)
					printf("%d", i);
				else
					printf(",%d", i);
				h++;
			}
		}
		flag=0;
		tip=0;
		sign=0;
		/*????????????*/
	}
	if(h == 0)
		printf("no");
}
int sushu(int a)
{   int i,k,t;
    k=(int)sqrt(a);
    for(i=3;i<=k;i=i+2)
  { if(a%i!=0&&a%2!=0)
    t=1;
    else 
    {t=0;break;
}
         }  
    return t;
}
int check(int a)
{     int t,b[100],k;
      int i;
      for(i=1;a!=0;i++)
      {b[i]=a%10;
        a=a/10;
        k=i;
                   }   
    for(i=1;i<=k/2;i++)
    if(b[i]==b[k-i+1])
      t=1;
    else 
    {t=0;break;}
    return t;
}
main()
{   int n,m;
    scanf("%d%d",&n,&m);
    int i,con=0;
    for(i=n;i<=m;i++)
    {if(check(i)==1&&sushu(i)==1&&con!=0)
      {   printf(",%d",i);
         con++;            }
    if(check(i)==1&&sushu(i)==1&&con==0)
     {printf("%d",i);
      con++;
     } 
}
   if(con==0)
   printf("no");
     }
int f(int a)
{
	int i;
	for(i=3;i<=sqrt(a);i+=2)
	{
		if(a%i==0)
		{
			return(0);
			break;
		}
	}
	return(1);
}

int g(int b)
{
	int n=0,i;
	int c;
	c=b;
	while(c>0)
	{
		n=n*10+c%10;
		c=c/10;
	}
	if(n==b)
		return(1);
	else 
		return(0);


}


main()
{
	int m,n;
	scanf("%d %d",&m,&n);
	if(m<=2)
		printf("2,");
	int j;
	int flag=0;
	if(m%2==0)
		m=m+1;
	for(j=m;j<=n;j+=2)
	{
		if(g(j)&&f(j))
		{
			flag=1;
			printf("%d",j);
			break;
		}
	}
	if(flag==0)
		printf("no");
	for(j=j+2;j<=n;j+=2)
	{
		if(f(j)&&g(j))
		{
			flag=1;
			printf(",%d",j);
		}
	}
}
void main()
{
	int ishw(long n);
	int isprime(long n);
	long m,n,first,flag=0,i;
	scanf("%ld%ld",&m,&n);
	for(i=m;i<=n;i++)
		if(isprime(i)&&ishw(i))
		{
			printf("%d",i);
			first=i;
			flag=1;
			break;
		}
	for(i=first+1;i<=n;i++)
		if(isprime(i)&&ishw(i))
		{
			printf(",%d",i);
		}


	if(flag==0)
			printf("no\n");
}
int isprime(long n)
{
	long i,k;
	k=n/2;
	for(i=2;i<=k;i++)
		if(n%i==0)
		{
			return(0);
			break;
		}
	if(i>k)
		return(1);
	else return(0);
}
int ishw(long n)
{
	long i,j,k,place=0;
    char s[9];
	for(i=0;n!=0;i++)
	{
		s[i]=n%10;
		n/=10;
		place=i+1;
	}
		//ltoa(n,s,10);/*?????????????*/
		k=place;
		j=-1;
		do
		j++;
		while(s[j]==s[k-j-1]&&j+1<=k/2);
		if(j+1>k/2)
			return(1);
		else return(0);
}
int huiwen(int a,int n)
{
if(a/10==0) return(n*10+a);
else return(huiwen(a/10,n*10+a%10));
}

main()
{
int a,b,j,flag1,flag2=0,i,k,h;
scanf("%d%d",&a,&b);
  for(i=a;i<=b;i++)
  {
	  flag1=1;
      k=sqrt(i);
    for(j=2;j<=k;j++)
	{
		if(i%j==0) flag1=0;
	}
    if(flag1) 
	{
		h=huiwen(i,0);
		if(h==i) 
		{
			if(flag2!=0) printf(",");
			printf("%d",i);
			
			flag2=1;
		}
	}
  }
  if(flag2==0) printf("no");
}
void main()
{
	int m,n,i,j,k=0,x;
	scanf("%d%d",&m,&n);
	if(m==2) 
	{
		k=1;
		printf("2");
	}
   if(m%2==0) m=m+1;
	for(i=m;i<=n;i+=2)
	{
		for(j=3;j<=sqrt(i);j=j+2)
		{
			if(i%j==0) break;
		}
		if(j>sqrt(i))
		{
			if(i<10) x=i;
			else if(i<100) x=i%10*10+i/10;
			else if(i<1000) x=i/100+i%100/10*10+i%10*100;
			else if(i<10000) x=i/1000+i%1000/100*10+i%100/10*100+i%10*1000;
			else  x=i/10000+i%10000/1000*10+i%1000/100*100+i%100/10*1000+i%10*10000;
			if(x==i)
			{
				if(k==0) printf("%d",i);
				else printf(",%d",i);
				k++;
			}
		}
	}
	if(k==0) printf("no\n");
}
void main()
{int m,n,a,b,c,i;
int sushu(int x);
int huiwen(int y);
scanf("%d%d",&m,&n);
for(i=m;i<=n;i++)
{
	a=sushu(i);
	if(a==1)
	{
		b=huiwen(i);
		if(b==1)
		{
			m=i;
			printf("%d",i);
			c=1;
			break;
		}
		else
			c=0;
	}
}
if(c==0)
printf("no");
else
{
	for(i=m+1;i<=n;i++)
	{
		a=sushu(i);
		if(a==1)
		{
			b=huiwen(i);
			if(b==1)
				printf(",%d",i);
		}
	}
}
}
int sushu(int x)
{
	int j,u;
	for(j=2;j<=x/2;j++)
	{
		if(x%j==0)
		{	u=0;
		break;}
		else
			u=1;

	}
	return(u);
}
int huiwen(int y)
{
	int p=y;
	int q=0;
	while(p>0)
	{
		int r=p%10;
		q=q*10+r;
		p=p/10;
	}
	if(q==y)
		return(1);
	else
	    return(0);
}
int prime(int x)
{
  int i,m;
  double k;
  k=sqrt(x);
  for(i=2;i<=k;i++)
  {if(x%i==0)
  break;}
  if(i>k) m=1;
  else m=0;
  return m;
}
int round(int y)
{
  int a[10000],j,n,l,sum=0,c;
  for(j=0;y!=0;j++)
  {a[j]=y%10;
  y=y/10;}
  for(l=0;l<j;l++)
  {if(a[l]!=a[j-1-l])
   break;}
   if(l==j) n=1;
  else n=0;
  return n;
}
main()
{ int p,q,s,count=0;
  scanf("%d %d",&p,&q);
  for(s=p;s<=q;s++)
  {if(prime(s)==1&&round(s)==1)
   {count++;
   if(count==1)
   printf("%d",s);
   else if(count!=1)
   printf(",%d",s);}
  }
  if(count==0)
  printf("no\n");
  getchar();
  getchar();
  getchar();
}
void main()
{   int hw(int(c));
	int m,n,i,j,t;
	t=0;
	
	scanf("%d %d",&m,&n );
	for(i=m;i<=n;i++)
	{
	for(j=2;j<i;j++)
	{
	if(i%j==0)
	break;
	if(j>=i-1)
	if (hw(i))
	{
      
	  t=t+1;
	  if(t==1)
		  printf("%d",i);
	  else
		  printf(",%d",i);
	}
	
	}


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


int hw(int(c))
{
	int x,y;
	x=0;
	y=c;
	do
	{x=10*x+y%10;
	y=y/10;
	}
	while(y>0);
	if (x==c)
		return(1);
	else
		return(0);
}
void main()
{int a(int x);
int b(int y);	
	int m,n,i=0,k,j;
	int c[20];
	scanf("%d %d",&m,&n);
	for(k=m;k<=n;k++)
	{if(a(k)==1&&k==b(k))
		{c[i]=k;
	i++;}
	}if(i==0)printf("no");
	else{printf("%d",c[0]);
		for(j=1;j<i;j++)
			printf(",%d",c[j]);}
}
int a(int x)
	{
		int k,t;
		k=sqrt(x);
		for(t=2;t<=k;t++)
			if(x%t==0)break;
			if(t>k)return(1);
			else return(0);
	}
int b(int y)
{
	int a1,a2,a3,a4,a5,a6,a7,a8;
	int z;
	a1=y/10000000;
	a2=(y%10000000)/1000000;
	a3=(y%1000000)/100000;
	a4=(y%100000)/10000;
	a5=(y%10000)/1000;
	a6=(y%1000)/100;
	a7=(y%100)/10;
	a8=y%10;
	if(a1!=0)z=a8*10000000+a7*1000000+a6*100000+a5*10000+a4*1000+a3*100+a2*10+a1;
	else if(a2!=0)z=a8*1000000+a7*100000+a6*10000+a5*1000+a4*100+a3*10+a2;
		else if(a3!=0)z=a8*100000+a7*10000+a6*1000+a5*100+a4*10+a3;
		else if(a4!=0)z=a8*10000+a7*1000+a6*100+a5*10+a4;
		else if(a5!=0)z=a8*1000+a7*100+a6*10+a5;
		else if(a6!=0)z=a8*100+a7*10+a6;
		else if(a7!=0)z=a8*10+a7;
		else z=a8;
		return(z);
}
int main()
{
	int m,n,i,k=2,t=0,u,s=0,r=1,b=1,flag=1;
	
	scanf("%d %d",&m,&n);
	for(i=m;i<=n;i++){
		for(k;k<i;k++){
			if(i%k==0)
				t++;
		}
		if(t==0){
			r=i;
			while(r!=0){
				u=r%10;
				s=s*10+u;
				r=r/10;
			}
			if(s==i && b!=1){
				printf(",%d",i);
				flag=0;
			}
			if(s==i && b==1){
				printf("%d",i);
				b++;
				flag=0;
			}
		}
		k=2;
		t=0;
		s=0;
	}
	if(flag==1)
		printf("no");
	return 0;
}
int f1(int x);
int f2(int x);
void main()
{
	int m,n,i,t=0,a[100],j;
	scanf("%d%d",&m,&n);
	for(i=m;i<=n;i++)
		if(f1(i)&&f2(i))
		{
			a[t]=i;
			t++;
		}
	if(t==0)
		printf("no");
	else

		for(j=0;j<t;j++)
		{
			printf("%d",a[j]);
			if(j<t-1)
				printf(",");
		}
}
int f1(int x)
{
	int n=0,y;
	y=x;
	while(y>0)
	{
		n=n*10+y%10;
		y=y/10;
	}
	if(x==n)
		return 1;
	else return 0;
}
int f2(int x)
{
	int i=2;
	while(x%i!=0&&i<=sqrt(x))
		i++;
	if(i>sqrt(x))
		return 1;
	else return 0;
}
void main()
{
	int m, n,a,i,j,temp,x,y;
	scanf("%d",&m);
	scanf("%d",&n);
	for(j=0;m<=n;m++)
	{
		if(m==1)
			continue;
		for(i=2;i<m;i++)
		{
			a=m%i;
	        if(a==0)
				break;
		}                   //???????
	    if(a!=0)            // printf("%d\n",m);
		{
			temp=m;
			y=0;
			while(temp>0)
			{	
				x=temp%10;
				y=y*10+x;
				temp=temp/10;
			}
			if(m==y)          //?????
			{   
				j=j+1;        //??m????????
				if(j==1)
					printf("%d",m);
			    else
					printf(",%d",m);
			}
		}
	}
	if(j==0)
		printf("no");
}
int su(int i)
{
	if (i==1) return(0);
	else
	{
	    int j,k,flag=1;
	    k=sqrt(i);
	    for (j=2;j<=k;j++)
		{
		    if (i%j==0)
			{
			    flag=0;
			    break;
			}
		}
	return(flag);
	}
}

int huiwen(int i)
{
	int k=0,x;
	x=i;
	while (i>0)
	{
		k=10*k+i%10;
		i=i/10;
	}
	if (x==k)
		return(1);
	else
		return(0);
}

void main()
{
	int i,m,n,a[100],k=0;
	scanf("%d%d",&m,&n);
	for (i=m;i<=n;i++)
		if (su(i)&&huiwen(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]);
	}
}
void main()
{
	double m,n,a,b,c,d,e;
	int p,q,t,mark[65500],su,sunum,i,num,num1;
	scanf("%lf %lf",&m,&n);
	p=log10(m);
	q=log10(n);
	for(i=0;i<65500;i++) mark[i]=0;
	for(i=m;i<=n;i++)
	{
		a=floor(i/10000);
		b=floor((i-a*10000)/1000);
		c=floor((i-a*10000-b*1000)/100);
		d=floor((i-a*10000-b*1000-c*100)/10);
		e=floor(i-a*10000-b*1000-c*100-d*10);
		t=log10(i);
		switch(t)
		{
		case 0:mark[i]++;break;
		case 1:if(e==d) mark[i]++;break;
		case 2:if(c==e) mark[i]++;break;
		case 3:if((b==e)&&(c==d)) mark[i]++;break;
		case 4:if((a==e)&&(b==d)) mark[i]++;break;
		}
		sunum=0;
		for(su=2;su<i;su++)
			if(i%su==0) sunum++;
		if(sunum==0) mark[i]++;
		if(i==0) mark[i]=0;
		if((i==1)||(i==2)) mark[i]=2;
	}
	num=0;
	num1=0;
	for(i=m;i<=n;i++)
		if(mark[i]==2) num++;
	if(num==0) printf("no");
	else for(i=m;i<=n;i++)
	{
		if(mark[i]==2)
		{
		num1++;
		if(num1<num) printf("%d,",i);
		else printf("%d",i);
		}
	}
}
int main () {
    int m,n,i,j,k,t,s,b=0,z,o,v=0,a[100],p[100],l[100];
	scanf ("%d %d",&m,&n);
	for (i=m;i<=n;i++) 
	{
		z=0;
		k=0;
		s=i;
		t=0;
		v=0;
		for (j=1;j<=i;j++) {
			
			if (i%j==0) t++;
		}
		while (s!=0){
		    
			a[k]=s%10;
			p[z]=s%10;
			s=s/10;
			k++;
			z++;
		}
	
		for (k=0,o=z-1;k<z,o>=0;k++,o--){
			if (a[k]==p[o]) v++;
		}
		if (t==2 && v==z){
			l[b]=i;
			b++;
		}
	}
	if (b==0) printf ("no");
    else printf ("%d",l[0]);
         for (i=1;i<b;i++){
		 printf (",%d",l[i]);
		 }
    return 0;
}
int huiwen(long n)
{
	long m=0,t=n;
	while(n>=1)
	{m=10*m+n%10;
	n=n/10;}

	if(m==t)
		return 1;
	else return 0;
	
}
int su(long n)
{
	long m,i,k;
	if(n==2)
		return 1;
	else if(n%2==0)
		return 0;
	else for(i=3;i<n/2;i++)
		if(n%i==0)
			return 0;
		return 1;
}

void main()
{
	long m,n,i,k,b[300];
	scanf("%ld%ld",&m,&n);
	for(i=m,k=0;i<=n;i++)

		if(su(i)*huiwen(i)==1)
		{b[k]=i;
		k++;}
		if(k==0)
			printf("no");
		else
		{
			printf("%ld",b[0]);
			if(k>1)
				for(i=1;i<k;i++)
					printf(",%d",b[i]);
		}
}
void main()
{
	int prime(int n);
	int palin(int n);
	int m,n,i=0;
	scanf("%d%d",&m,&n);
	for(;m<=n;m=m+1)
	{
		if(palin(m)==1 && prime(m)==1)
		{
			if(i==0)
				printf("%d",m);
			else
				printf(",%d",m);
			i=i+1;
		}
	}
	if(i==0)
		printf("no");
}

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

int palin(int n)
{
	int a[5];
	int i,c,flag=1;
	c=log10(n);
	for(i=0;i<=c;i=i+1)
	{
		a[i]=n/pow(10,c-i);
		n=n-a[i]*pow(10,c-i);
	}
	for(i=0;i<=c;i=i+1)
	{
		if(a[i]==a[c-i])
			continue;
		else
		{
			flag=0;
			break;
		}
	}
	return(flag);
}
void main()
{
	int n,m,x,i,p,q,a[100],y,b[100]={0},z=0,j;
	double k;
	scanf("%d %d",&m,&n);
	for(x=m;x<=n;x++)
	{
		k=sqrt(x);
		for(i=2;i<k;i++)
		{
			if(x%i==0)
				break;
		}
		if(i>k)
			p=1;
		y=x;
		j=0;
		while(y>=1)
		{
			y=(double)y/10;
			j++;
		}
		y=x;
		for(i=0;i<j;i++)
		{
			k=pow(10,j-i-1);
			a[i]=y/k;
			y=y-a[i]*k;
		}
		for(i=0;i<j;i++)
		{
			if(a[i]!=a[j-i-1])
				break;
		}
		if(i==j)
			q=1;
		if(q==1&&p==1)
		{
			b[z]=x;
			z++;
			
		}
		p=0;q=0;
	}
	if(b[0]!=0)
	{
		for(i=0;i<z-1;i++)
			printf("%d,",b[i]);
		printf("%d\n",b[z-1]);
	}
	else printf("no\n");
}
int main()
{
	int m,n,i,j,k,a=0,b=0,z[100],zz=0,wan[9],wei,num;
	scanf("%d %d",&m,&n);
	for(i=m,a=0,b=0,wei=0;i<=n;i++)
	{
		a=0;
		b=0;
		for(j=0;j<9;j++)
			wan[j]=0;
		k=sqrt(i);
		for(j=2;j<=k;j++)
			if(i%j==0)
				break;
		if(j>k) a++;
		num=i;
		for(j=0;j<9;j++)
		{
			wan[j]=num%10;
			num=num/10;
			wei=j;
			if(num<1) break;
		}
		for(j=0;j<=wei;j++)
		{
			if(wan[j]!=wan[wei-j]) break;
		}
		if(j>wei) b++;
		if(a*b!=0)
		{
			z[zz]=i;
			zz++;
		}
	}
	if(zz==0) printf("no");
	else
	{
		for(i=0;i<zz;i++)
		{
			if(i==0) printf("%d",z[i]);
			else printf(",%d",z[i]);
		}
	}
	printf("\n");
	return 0;
}
void main()
{int a,b,i,j,k,s,t=0;
 scanf("%d %d",&a,&b);
 for(i=a;i<=b;i++)
 {for(j=2;j<=sqrt(i);j++)
    if(i%j==0)
		break;
	if(j>sqrt(i))
	{k=i;
	 s=0;
	 while(k>0)
	 {s=10*s+k%10;
	 k=k/10;}
	 if(s==i)
	 {if(t!=0)
	  printf(",");
	  printf("%d",i);
	  if(t==0)
		  t++;}
	}
	}
 if(t==0)
	 printf("no");
}
int main()
{
    int m,n,i,t,j,y,a,b;
    scanf("%d %d",&m,&n);
    for(i=m,t=0;i<=n;i++)
    {
        for(j=2;j<i;j++)
            if(i%j==0) break;
        for(y=0,a=0,b=i;b!=0;)
        {
            a=b%10;
            b=b/10;
            y=y*10+a;
        }
        if(j==i && y==i) 
        {
            if(t==0) 
            {
                printf("%d",i);
                t++;
            }
            else printf(",%d",i);
        }
    }
    if(t==0) printf("no");
    getchar();
    getchar();
}
int reverse(long x)
{
	long t=x,r=0;
	while(t!=0)
	{
		r=10*r+t%10;
		t/=10;
	}
	if(r==x) return(1);
	else return(0);
}
int prime(long x)
{
	long i;
	for(i=2;i<=sqrt(x);i++)
		if(x%i==0)
			break;
	if(i>sqrt(x)) return(1);
	else return(0);
}
void main()
{
	long m,n,i,j=0;
	scanf("%ld%ld",&m,&n);
	for(i=m;i<=n;i++)
		if(reverse(i)&&prime(i))
		{
			j++;
			printf((j==1)?"%ld":",%ld",i);
		}
		if(j==0)
			printf("no");
}
void main()
{
	int m,n,i,j,a=0,b=0,c=0,d,p=0,q=0,k=0;
	scanf("%d%d",&m,&n);
	if(m%2==0)
		m=m+1;
	for(i=m;i<=n;i=i+2)
	{
		for(j=3;j<=sqrt(i);j=j+2)
		{
			if(i%j!=0)
			{
				b=b+1;}
			else
			{b=0;break;}
		}
          if(b!=0)
		  { 
			  d=i;
			  q=q+1;
			  while(d>0)
			{
				a=d%10;
				c=10*c+a;
				d=d/10;
			}
			if(c==i)
			{p=p+1;
			k=k+1;
			if(p==1)
			{printf("%d",i);
			c=0;}
			else
			{printf(",%d",i);
			c=0;}
			}
		  else
		  { c=0;}}
		  
		

		  

	}

			if(q==0||k==0)
			printf("no");
}
int huiwen(long n)
{
	int a[11],i=0;
	while(n!=0)
	{
		a[i]=n%10;
		i++;
		n=n/10;
	}
	int j;
	for(j=0;j<i/2;j++)
		if(a[j]!=a[i-1-j])
			return 0;
	return 1;
}
int sushu(long n)
{
	long i;
	for(i=2;i<=(long)sqrt(n);i++)
		if(n%i==0)
			return 0;
		return 1;
}
void main()
{
	int i,count=0;
	long m,n,temp;
	scanf("%ld%ld",&m,&n);
	if(m>n)
	{
		temp=m;
		m=n;
		n=temp;
	}
	for(i=m;i<=n;i++)
	{
		if(huiwen(i)&&sushu(i))
		{
			printf("%ld",i);
			count++;
			break;
		}
	}
	if(count==0)
		printf("no");
	else 
		for(i++;i<=n;i++)
		{
			if(huiwen(i)&&sushu(i))
				printf(",%ld",i);
		}
}
int main()
{
	int x[1001],y[1001],i=1,j,t,r[1001]={0},max,maxy;
	char c=',';
	for(;;)
	{
		cin>>x[i];
		c=getchar();
		if (c=='\n') break;
		i++;
	}
	i=1;
	for(;;)
	{
		cin>>y[i];
		c=getchar();
		if (c=='\n') break;
		i++;
	}
	maxy=0;
	for (j=1;j<=i;j++)
		if (y[j]>maxy)
			maxy=y[j];
	max=0;
	for (t=0;t<=maxy;t++)
	{
		for (j=1;j<=i;j++)
		{
			if ((x[j]<=t) && (t<y[j]))
				r[t]++;

		}
		//cout<<t<<' '<<r[t]<<endl;

		if (max<r[t])
			max=r[t];
	}

	cout<<i<<' '<<max;


	return 0;
}
int main()
{
	int time1[1000];
	int time2[1000];
	int people=0;
	int num_of_time[1000]={0};
	char nouse;

	while(cin>>time1[people])
	{
		people++;
		if(cin.peek()=='\n')
			break;
		cin.ignore();
	}
	for(int k=0;k!=people-1;k++)
		cin>>time2[k]>>nouse;
	cin>>time2[people-1];

	for(int k=0;k!=people;k++)
	{
		for(int time=time1[k];time!=time2[k];time++)
		{
			num_of_time[time]++;
		}
	}
	int max=0;
	for(int k=0;k!=1000;k++)
		if(num_of_time[k]>max)
			max=num_of_time[k];

	cout<<people<<" "<<max<<endl;
	return 0;
}
int main()
{
	char a[10000],b[10000];
	int x[10000], y[10000], c[10000];
	int i,j, p;
	gets(a);
	gets(b);
	char* z=strtok(a,",");//?????
	p = 0;
	while (z!=NULL) 
	{
		x[++p]=atoi(z);//????????????????
		z=strtok(NULL,",");//???????,?????????????
	}
	z = strtok(b,",");
	p = 0;
	while (z!=NULL)
	{
		y[++p]=atoi(z);
		z=strtok(NULL,",");
	}
	memset(c,0,sizeof(c));
	for (i=1;i<=p;i++)
		for (j=x[i];j<y[i];j++)
		{
			c[j]++;
		}
	int max=0;
	for(int g=1;g<=10000;g++) 
	{
		if(c[g]>max)  max=c[g];
	}
	cout<<p<<" "<<max<<endl;
	return 0;
}
int a[1005],b[1005];
int tm[1005];
int main()
{
  int n,t=0,i,j,k=0;
  char m;
  while(1)
  {
  scanf("%d",&a[++t]);
  scanf("%c",&m);
  if(m == '\n') break;
  }
  for(i =1 ;i <= t;i++)
  {
     scanf("%d",&b[i]);
     scanf("%c",&m);
  }
  for(i = 1;i <= t;i++)
     for(j = a[i];j < b[i];j++)
        {
             tm[j]++;
             if(tm[j]>k)  k = tm[j];  
        }
  printf("%d %d",t,k);
 return 0;    
}
/*?????   
 
?? ??-From WHF 
?? 
???????????????????????????????????????????????????????????????????????i????????????????????xi, yi????????????????t?? xi <= t < yi????????????????????? 0 <= xi < yi<1000?????????????????????????????????????????
 
???? 
????2???2????????? 
?1????i???????xi?????????? 
?1????i??????????yi??????????? 
??? 
2,5,4,6,7,3,1,6,2 
5,6,7,7,8,4,3,9,4 

???9????????????? 
[2,5),[5,6),[4,7),[6,7),[7,8),[3,4),[1,3),[6,9),[2,4)
 
???? 
??????????????????????????????? 
???????????????9????????3????????????[2,5),[1,3),[2,4)
 
???? 
2,5,4,6,7,3,1,6,2
5,6,7,7,8,4,3,9,4

 
???? 
9 3

 
?? 
? 
*/
int change(char a[],int n)
{
	int i;
	int s=0;
	for(i=0;i<=n-1;i++)
	{
		s=s*10+a[i]-'0';
	}
	return(s);
}
main()
{
	int n=0,i=0,j=0,k;
	char s1[10000],s2[10000],x1[1000][1000],y1[1000][1000];
	int x[1000],y[1000],xl[1000],yl[1000],num[1000]={0};
	gets(s1);
	gets(s2);
	for(k=0;k<=strlen(s1)-1;k++)
	{
		if(s1[k]!=',')
		{
			x1[i][j]=s1[k];
			j++;
		}
		else
		{
			xl[i]=j;
			i++;
			j=0;
		}	
	}
	if(k==strlen(s1))
	{
		xl[i]=j;
		i++;
	}
	n=i;
	j=0;i=0;
	for(k=0;k<=strlen(s2)-1;k++)
	{
		if(s2[k]!=',')
		{
			y1[i][j]=s2[k];
			j++;
		}
		else
		{
			yl[i]=j;
			i++;
			j=0;
		}	
	}
    if(k==strlen(s2))
	{
		yl[i]=j;
		i++;
	}
	for(i=0;i<=n-1;i++)
	{
		x[i]=change(x1[i],xl[i]);
		y[i]=change(y1[i],yl[i]);
	}
	for(i=0;i<1000;i++)
	{
		num[i]=0;
	}
	for(i=0;i<1000;i++)
	{
		for(j=0;j<=n-1;j++)
		{
		if(i>=x[j]&&i<y[j])
		{
			num[i]++;
		}
		}
	}
	k=0;
	for(i=0;i<1000;i++)
	{
		if(num[i]>=k)
		{
			k=num[i];
		}
	}
	printf("%d %d",n,k);
}
int main()
{
	int x[1001] , y[1001] , t[1001] = {0} ;
	int i , j , k , m = 0 ;
	char a = ',' ;
	for (i = 1 ; a == ',' ; i ++)
	{
		cin >> x[i] ;
		a = cin.get();
	}
	a = ',' ;
	for (i = 1 ; a == ',' ; i ++)
	{
		cin >> y[i] ;
		a = cin.get() ;
	}
	cout << i - 1 << " " ;
	for(j = 1; j < i; j++)
	{
		for(k = x[j]; k < y[j]; k++)
			t[k] = t[k] + 1;
	}
	for(int l = 1; l <= 1000; l++)
	{
		if(t[l] > m)
			m = t[l];
	}
	cout << m << endl;
	return 0;
}