import java.util.*


fun main(args: Array<String>) {
    val sieve = SieveOfEratosthenes(55555L)
    val N = readLine()!!.toInt()

    println(sieve.primes.filter { it % 5 == 1L }.take(N).joinToString(" "))
}

class SieveOfEratosthenes(n: Long) {
    private val isPrime = Array(n.toInt() + 1) { true }

    /**
     * A list of primes less than or equal to `n`.
     */
    val primes: List<Long>

    init {
        isPrime[0] = false
        isPrime[1] = false
        val primeList = ArrayList<Long>()

        for (i in 2..n.toInt()) {
            if (!isPrime[i]) {
                continue
            }

            primeList.add(i.toLong())
            for (j in i * 2 .. n.toInt() step i) {
                isPrime[j] = false
            }
        }

        primes = Collections.unmodifiableList(primeList)
    }

    /**
     * @return `true` if `i` is prime.
     */
    fun get(i: Long): Boolean {
        return isPrime[i.toInt()]
    }
}

