import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int n = input.nextInt(), m = input.nextInt();
for (int i = n; i <= m; i++) {
boolean flag = true;
if (i == 1) {
flag = false;
}
for (int j = 2; j < i; j++) {
if (i % j == 0) {
flag = false;
}
}
if (flag) {
System.out.println(i);
}
}
}
}
优化
for (int i = n; i <= m; ++i) {
if (i == 1) {
continue;
}
boolean flag = true;
for (int j = 2; j < i; ++j) {
if (i % j == 0) {
flag = false;
}
}
if (flag) {
System.out.println(i);
}
}