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

solve n = take n $ filter ((== 1) . (`mod` 5)) primes

primes :: [Int]
primes = [2, 3, 5, 7] ++ filter isPrime ns
    where
      ns = [11, 13..]
      isPrime n = all ((/= 0) . (n `mod`)) $ takeWhile ((<= n) . (^2)) primes
