#include<bits/stdc++.h>
using namespace std;
int s=0;
bool x(int y){
int z=y;
for(int i=2;i*i<=y;i++){
if(y%i==0) return 0;
}
while(z){
s=s*10+z%10;z/=10;
}
if(s==y) return 1;
return 0;
}
int m,n;
bool f;
int main(){
cin>>m>>n>>f;
f=1;
for(int i=m;i<=n;i++)
if(x(i)){
if(f){
cout << ",";
cout << i;
}else{
cout <<"No";
}
}
return 0;
}