#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main() {
	int n;
	cin >> n;
	vector<int> primes;
	vector<int> is_prime(55556, -1);
	for (int i = 2; i <= 55555; i++) {
		if (is_prime[i] != -1) continue;
		primes.push_back(i);
		is_prime[i] = 1;
		for (int j = i+i; j <= 55555; j+=i) {
			is_prime[j] = 0;
		}
	}
	int k = 0;
	for (int x: primes) {
		if (k == n) break;
		if (x % 5 == 1) {
			cout << x << " ";
			k++;
		}
	}
	cout << endl;
}
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
const int MAX = 55556;
vector<bool> ok(MAX, true);
signed main(void)
{
	int n;
	vector<int> vec;

	cin >> n;
	ok[0] = ok [1] = false;
	rep(i, sqrt(MAX))
	{
		if (ok[i])
		{
			for (int j = 0; i * (j + 2) < MAX; j++)
			{	
				ok[i * (j + 2)] = false;
			}
		}
	}
	for(int i = 6; i < MAX; i += 5)
	{
		if (ok[i])
			vec.push_back(i);
	}
	sort(vec.begin(), vec.end());
	rep(i, n)
	{
		printf("%d%c", vec[i], i == n - 1?'\n':' ');
	}
	return 0;
}
