import java.util.Scanner;
public class FindPrimes {
public static void main(String[] args) {
Scanner c = new Scanner(System.in);
int a = c.nextInt();
int b = c.nextInt();
int m=0,n=0;
if(a == b){
System.out.println("m和n相等");
System.exit(0);
}else{
if(a>b){
m = b;
n = a;
}else{
m = a;
n = b;
}
}
for (int i = m; i <= n; i++) {
//遍历整除时,只需遍历到二分之一i加1即可
int k = (int)Math.ceil(i/2);
boolean flag = true;
//从2到N遍历
for (int j = 2; j <= k; j++) {
//能被整除,不是素数
if(i%j==0){
flag = false;
}
}
if(flag){
System.out.println(i);
}
}
}
}
public class PrimeDemo {
public static void main(String[] args) {
getPrime(1, 1000);
}
// 求两数之间的素数
static void getPrime(int begin, int end) {
if (begin > end || begin < 1) return;
if (begin < 2) begin = 2;
StringBuffer sb = new StringBuffer();
for (int i = begin; i <= end; i++) {
boolean canGo = false;
for (int j = 2; j <= i; j++) {
if (i % j == 0 && j != i) {
canGo = true;
break;
}
}
if (canGo) continue;
sb.append(i).append(",");
}
sb.setLength(sb.length() - 1);
System.out.println(sb.toString());
}
}