#include<iostream>
using namespace std;
bool b[100000001];
bool hw(int x){
if((x%10)%2==0) return false;
int c[10];
int k=0;
while(x>0){
k++;
c[k]=x%10;
x=x/10;
}
for(int i=1;i<=k/2;i++){
if(c[i]!=c[k-i+1]) return false;
}
return true;
}
int main(){
int l,r;
cin>>l>>r;
b[2]=false;
for(int i=2;i*i<=r;i++){
if(b[i]==false){
for(int j=i;j*i<=r;j++){
b[i*j]=true;
}
}
}
for(int i=l;i<=r;i++){
if(b[i]==false && hw(i)){
cout<<i<<endl;
}
}
return 0;
}
```cpp