#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<deque>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

bool isPrime[100010];
void set_prime() {
	for (int i = 1; i <= 100000; i++) {
		isPrime[i] = true;
	}
	isPrime[0] = false; isPrime[1] = false;
	for (int i = 2; i * i <= 100000; i++) {
		int j = 2;
		while (i * j <= 100000) {
			isPrime[i * j] = false;
			j++;
		}
	}
}

int main()
{
	int N;
	cin >> N;
	set_prime();
	int j = 2;
	for (int i = 0; i < N; i++) {
		while (true) {
			if (isPrime[j] && j % 5 == 1) {
				cout << j++ << " ";
				break;
			}
			j++;
		}
	}
	cout << endl;
}

#include <iostream>

using namespace std;

int main()
{
	int a[55556];
	fill(a, a + 55556, 1);
	a[0] = a[1] = 0;
	for (int i = 4; i < 55556; i += 2) {
		a[i] = 0;
	}
	for (int i = 3; i * i < 55556; i += 2) {
		if (a[i] == 1) {
			for (int j = i + i; j < 55556; j += i) {
				a[j] = 0;
			}
		}
	}

	int n;
	cin >> n;
	for (int i = 11, j = 0; j < n; i += 5) {
		if (a[i] == 1) {
			cout << i << (j == n - 1 ? "\n" : " ");
			j++;
		}
	}

	return 0;
}