fun main(args: Array<String>) = panasonic2020d()

fun panasonic2020d() {
    val n = readLine()!!.toInt()

    fun dfs(string: String, max: Char): List<String> {
        return if (string.length == n) {
            listOf(string)
        } else {
            ('a'..max).map { dfs(string + it, if (it == max) max + 1 else max) }.flatten()
        }
    }

    val answer = dfs("", 'a').sorted().joinToString(System.lineSeparator())

    println(answer)
}
