using std::cout; using std::cin; using std::endl;
int main() {
int a = 0, b = 0;
cin >> a >> b;
for (int i = a; i <= b; ++i)
{
bool x = true;
for (int j = 2; j * j <= i; ++j)
{
if (i % j == 0)
{
x = false;
break;
}
}
if (x&&i!=1)
{
cout << i <<endl;
}
}
}