package com.hym.PAT_B;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/**
* Created by ymhou on 2016/11/22.
* PAT官网部分测试点运行超时(100ms运行时间限制),牛客网运行通过
*/
public class PAT_B_1013 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int M = scanner.nextInt();
int N = scanner.nextInt();
List<Integer> list;
list = GetnPrimeList(N);
for(int i=M-1; i<N; i++){
System.out.print(list.get(i));
if((i-M+2)%10 !=0){
if(i==N-1) break;
System.out.print(" ");
}else {
System.out.println();
}
}
}
public static List<Integer> GetnPrimeList(int num){
List<Integer> list = new ArrayList<Integer>();
int startNumber = 1;
while(list.size() < num){
if(IsPrime(startNumber,list)){
list.add(startNumber);
}
startNumber++;
}
return list;
}
public static boolean IsPrime(int num,List<Integer> list){
if(num==1){
return false;
}
int max = (int) Math.sqrt(num);
for(int n:list){
if(num%n==0){
return false;
}
if(n>max){
break;
}
}
return true;
}
}