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

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

main = do
    n <- getInt
    mapM_ print $ sort (map (\(x, _) -> reverse x) (solve n))

solve 1 = [("a", 1)]
solve k = [ (c : ss, max m m')  | (ss, m) <- solve (k - 1), (c, m') <- cs, m' - m <= 1 ]
    where cs = take k $ zip "abcdefghij" [1..]