import scala.io.{StdIn => in}
import scala.collection.{mutable => mu}
import annotation.tailrec

object Main extends App {
  val an = 55555
  val isPrime = eratos(an)
  val n =  in.readInt
  val seq = mu.ListBuffer.empty[Int]

  @tailrec
  def rec(cnt:Int, num:Int):Unit = {
    if(cnt == n) return
    else if(num % 5 == 1 && isPrime(num)){
      seq += num
      rec(cnt+1, num+2)
    }
    else rec(cnt, num+2)
  }
  rec(0,11)

  val ans = seq.mkString(" ")
  println(ans)

  def eratos(n:Int):Array[Boolean] = {
    val ret = Array.fill(n+1)(true)
    ret(0) = false
    ret(1) = false
    for(i <- 2 to n) {
      if(ret(i)) {
        var j = i + i
        while(j <= n) {
          ret(j) = false
          j += i
        }
      }
    }
    ret
  }
}