import Control.Monad
import Data.List

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

solve :: Int -> [Int]
solve n =
  head [xs | xs <-comb n qs, ys <-comb 5 xs, not (isPrime (sum ys))]
  where
    qs = takeWhile (<=55555) prime


prime :: [Int]
prime = 2:[i |i<-[3..], isPrime i ]

isPrime i =
  and[i`mod`p/=0 | p <- takeWhile (<=u) prime]
  where
    u = floor(sqrt(fromIntegral i))

comb :: Int -> [a] -> [[a]]
comb 1 xs     = map (:[]) xs
comb n (x:xs) = map (x:) (comb (n-1) xs) ++ comb n xs
comb _ _      = []