main :: IO ()
main = readLn >>= printRes . solve 
    where
        printRes = putStrLn . unwords . map show 

solve :: Int -> [Int]
solve = flip take xs
    where
        xs = filter (\x -> x `mod` 5 == 1) primes

primes :: [Int]
primes = build [2..]
    where
        build (x : xs) = x : build (filter (\n -> n `mod` x /= 0) xs)