#include <iostream>
#include <cmath>
using namespace std;
bool isp(int n)
{
if (n < 2)
return 0;
for (int i = 2; i <= sqrt(n); i++)
if (n % i == 0)
return 0;
return 1;
}
int main()
{
/*for (int i = 11; i < 100; i++)
if (isp(i))
cout << i << " ";
*/
int pri[9] = {11, 13, 17, 31, 37, 71, 73, 79, 97};
int a, b;
cin >> a >> b;
for (int i = 0; i < 9; i++)
{
if (pri[i] >= a && pri[i] <= b)
cout << pri[i] << endl;
}
return 0;
}