import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (n : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  mapM_ putStrLn . map (map toLEL) . f n $ 0

f :: Int -> Int -> [[Int]]
f 0 _ = [[]]
f l m = [0..m] >>= map <$> (:) <*> f (pred l) . max m . succ

toLEL :: Int -> Char
toLEL = toEnum . (fromEnum 'a' +)

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
