import Control.Monad
main = do
    n <- read <$> getLine :: IO Int
    mapM (putStrLn . reverse) (solve n)

solve :: Int -> [String]
solve 1 = ["a"]
solve n = [c:cs | cs <- solve (n-1),c <- [head cs,succ $ head cs],c <= 'z']