main :: IO ()
main = do
    n <- readLn :: IO Int
    let ns = filter ((== 1) . (`mod` 5)) ps
    putStrLn $ unwords $ map show $ take n ns

ps :: [Int]
ps = 2 : f [3] [3, 5..]
    where
      f (x:xs) ys = let (ps, qs) = span (< x^2) ys
                    in ps ++ f (xs ++ ps) [z | z <- qs, z `mod` x /= 0]
