import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (unfoldr)

main :: IO ()
main = do
  (n : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  let
    rev :: (Int, [(Int, [Int])])
    rev = until p f (1, [(0, [0])])
      where
        p :: (Int, [(Int, [Int])]) -> Bool
        p = (== n) . fst
        f :: (Int, [(Int, [Int])]) -> (Int, [(Int, [Int])])
        f = (,) <$> succ . fst <*> (>>= g) . snd
          where
            g :: (Int, [Int]) -> [(Int, [Int])]
            g (m, ds) = (succ m, (succ m) : ds) : map ((,) m . (: ds)) [m, (pred m)..0]
  mapM_ putStrLn $ map (map (toEnum . (97 +)) . reverse) . reverse . map snd . snd $ rev

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