import Data.List

main :: IO ()
main = do
  n <- readLn
  putStrLn . unwords . map show $ solve n

solve :: Int -> [Int]
solve n | n == 5 = take n (primes 55555)
        | otherwise = let ps = primes 55555
                          (base,xs) = splitAt 5 ps
                      in append (n-5) base xs
  where
    append 0 base _ = base
    append i base (x:xs) | ok base x = append (i-1) (x:base) xs
                         | otherwise = append i base xs
    ok ys x = all isPrime [x + s - y | let s = sum ys, y <- ys]

primes :: Int -> [Int]
primes n = 2 : eratos [3,5 .. n]
  where
    eratos [] = []
    eratos (p:xs) = p : eratos (xs \\ [p,3*p..n])

isPrime :: Int -> Bool
isPrime n = n == 2 || all (/=0) [n `mod` m | m <- [2..n']]
  where n' = floor $ sqrt $ fromIntegral n
