erast s = let erasti [] = []
              erasti (x:xs) = x : erasti (filter (\y -> y`mod`x /= 0) xs)
          in
          erasti [2..s]
putlis [] = putStrLn ""
putlis (x:xs) = do
                putStr $ show x ++ " "
                putlis xs
main = do
       n <- getLine
       putlis $ take (read n) $ filter (\x -> x `mod` 5 == 1) $ erast 55555