import qualified Data.Vector.Unboxed as U
import qualified Data.Vector as V
import qualified Data.ByteString.Char8 as C
import Data.List
import Control.Monad
import Data.Foldable
import Data.Char

r :: Int -> IO (U.Vector Int)
r n = U.unfoldrN n (C.readInt . C.dropWhile (==' ')) <$> C.getLine

r' :: IO [Int]
r'  =   unfoldr    (C.readInt . C.dropWhile (==' ')) <$> C.getLine


main :: IO ()
main = do
    n <- readLn :: IO Int
    mapM_ putStrLn $ solve n


solve n = solveAux 'a' n n

solveAux cur _     0  = [""]
solveAux cur ltrn len = do
    c <- take ltrn ['a'..cur]
    map (c:) (solveAux (max cur (nxt c) ) ltrn (len-1))


nxt c = chr (ord c + 1)
