#include <iostream>
#include <cstdio>
using namespace std;
const int N = 1000107;
int n, m, primes[N];
inline bool isPrime(int x)
{
for (int i = 2; i * i <= x; i++)
if (x % i == 0)
return false;
return true;
}
int main()
{
freopen("tinkle.in", "r", stdin);
freopen("tinkle.out", "w", stdout);
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n >> m;
int cnt = 0;
const int end = n + m;
for (int i = 2; cnt <= N; i++)
if (isPrime(i))
{
primes[++cnt] = i;
if (cnt > end)
break;
}
for (int i = n - m; i < n; i++)
cout << primes[i] << ' ';
for (int i = n + 1; i <= end; i++)
cout << primes[i] << ' ';
cout << endl;
return 0;
}