#include <iostream>
#include <algorithm>
#define maxSize 1000000
using namespace std;
void getAllPrime(int n, int allPrime[]) {
//获取前n个素数,保存在allPrime[]中
int count = 0;
int* temp = new int[maxSize];
for (int i = 0; i < maxSize; ++i) {
temp[i] = 0;
}
// int temp[maxSize] = {};//init to zero
for (int i = 2; i < maxSize; ++i) {
if (temp[i] == 0) {//0代表是素数
allPrime[count++] = i;
}
if (count == n) {
return;//已经够了
}
for (int j = i + i; j < maxSize; j += i) {
//j = 2*i,j = 3*i....
temp[j] = 1;//代表不是素数
}
}
}
int main() {
int *allPrime = new int[10000];//前10000个素数
int m, n;
cin >> m >> n;
getAllPrime(n, allPrime);
int flag = 0;
for (int i = m - 1; i < n; ++i) {
cout << allPrime[i];
if (i == n - 1) {
break;
}
++flag;
if (flag == 10) {
flag = 0;
cout << endl;
}
else {
cout << " ";
}
}
return 0;
}