#include <bits/stdc++.h>
#define N 100000010
using namespace std;
int a, b, nt[N];
void sang() {
fill(nt + 1, nt + N, 1);
nt[1] = 0;
for (int i = 2; i * i <= b; i++) {
if (nt[i] == 1) {
for (int j = i * i; j <= b; j += i) {
nt[j] = 0;
}
}
}
}
bool kt(int x) {
int h = 0;
while (x != 0) {
if (nt[x] == 0) {
return false;
break;
}
else return true;
x /= 10;
}
}
int main() {
freopen("SPRIME.inp", "r", stdin);
freopen("SPRIME.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> a >> b;
sang();
for (int i = 2; i <= b; i++) {
if (nt[i] == 1 && i >= a) {
if (kt[i] == true) {
cout << i << endl;
}
}
}
return 0;
}
45 12 [Warning] pointer to a function used in arithmetic [-Wpointer-arith]
45 17 [Error] ISO C++ forbids comparison between pointer and integer [-fpermissive]