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

sol :: Int -> [String]
sol 1 = ["a"]
sol n = map ("a"++) $ s ++ (map reverse $ tail s) ++ (map (map (chr.(+1).ord)) s)
    where
        ss = sol $ n-1
        s = nub $ ss

main :: IO ()
main = do
    n <- fst . fromJust . BS8.readInt <$> BS8.getLine

    putStr $ unlines $ sort $ sol n
