main :: IO()
main = do
  k <- readLn :: IO Int
  putStr . unlines $ take k [show n ++ ", " ++ show (n `div` (f (show n) 0)) | n <- [1..], snk n]

snk :: Int -> Bool
snk k = solve (drop 1 (show k)) || k < 10
  where
    solve :: String -> Bool
    solve "" = True
    solve (s:ss) = s == '9' && solve ss

