import Control.Monad
main = do
  n <- readLn
  forM_ (solve n) putStrLn

solve :: Int -> [String]
solve n = go 'a' n
  where
    go _ 0 = [""]
    go c n = concat [map (c' :) (go (succ c') (n-1))| c' <- ['a' .. c]]