#include<bits/stdc++.h>
using namespace std;
bool judge(int a)
{
if(a==1) return false;
if(a==2) return true;
for(int i=2;i<=sqrt(a);i++)
if(a%i==0) return false;
return true;
}
bool huiwen(int b)
{
int how,eve[10]={0},doing=b;
for(int i=7;i>=0;i--){
int mod=pow(10,i);
if(b/mod!=0) {how=i+1;break;}
}
for(int i=1;i<=how;i++){
eve[i]=doing%10;
doing=doing/10;
}
for(int i=how;i>how/2;i--)
if(eve[i]!=eve[how+1-i]) return false;
return true;
}
int main()
{
int be,end;
scanf("%d%d",&be,&end);
if(be<=2) printf("2\n");
for(int i=be;i<=end;i=i+2)
if(judge(i)&&huiwen(i)) printf("%d\n",i);
return 0;
}
错误的输入:750 14000