module Main where

import Control.Monad
import qualified Data.List as L

main :: IO ()
main = do
    line <- getLine
    let n = (read line) :: Int
    forM_ (make n) putStrLn

make :: Int -> [String]
make 1 = ["a"]
make n = L.concat $ fmap (\p -> append p) preList
    where
    preList = make (n - 1)

append :: String -> [String]
append s = fmap (\c -> s ++ [c]) ['a' .. next]
    where
    next = succ $ L.maximum s
