import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Char
import           Data.List
import           Data.Maybe

readInt = fst . fromJust . BS.readInt
getInt = readInt <$> BS.getLine



isNF ds = check (sort ds) (-1)
  where check [] _ = True
        check (d:ds) n = if d <= n + 1
                         then check ds d
                         else False

main = do
  n <- getInt
  let as = take n [0,0..]

  let printWs ds = do
        when (isNF ds) $ putStrLn $ map (\d -> chr (ord 'a' + d)) $ reverse ds
        case carry ds [] of
          Just ds' -> printWs ds'
          Nothing  -> return ()

      carry [0] _ = Nothing
      carry (x:xs) ys = if x + 1 < n
                        then Just (reverse ys ++ (x+1:xs))
                        else carry xs (0:ys)

  printWs as