import Data.Array
import Data.List
import Control.Monad.State
import Debug.Trace

prime n = f 2 [] $ listArray (2, n) [2..]
  where
   f i ps _
     | i > n = ps
   f i ps lpf = do
     let ps' = if (lpf ! i) == i then ps++[i] else ps
     let nlpf = takeWhile (\p -> (p * i <= n) && (p <= (lpf ! i))) ps'
     let lpf' = lpf // map (\p-> (p * i, p)) nlpf
     f (succ i) ps' lpf'

main = do
  n <- read $ getLine :: IO Int
  --let n = 4
  putStrLn $ intercalate " " $ map show $ take n $ filter (\i -> i `mod` 5 == 1) $ prime 3000
