import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  auto res = new int[](n);

  immutable MAX = 55_555;

	bool[MAX] p;
	p[] = true;
	p[0..2] = false;
	foreach (i; 2..sqrt(MAX*1.0).ceil.to!int) {
		if (p[i]) {
			foreach (j; iota(i*2, MAX, i))
				p[j] = false;
		}
	}

  int i;
  int j = 2;
  while (i < n) {
    while (!p[j] || j % 5 != 1) {
      j++;
    }
    res[i] = j;
    j++;
    i++;
  }

  writefln("%(%s %)", res);
}
