fun main(args: Array<String>) {
    val N = readInputLine().toInt()

    dfs(N, 1, "a", 1)
}

fun readInputLine(): String {
    return readLine()!!
}

fun dfs(length: Int, currentLen: Int, current: String, adder: Int) {
    if (currentLen == length) {
        println(current)
        return
    }
    repeat(adder) {
        dfs(length, currentLen + 1, current + ('a' + it).toString(), adder)
    }
    dfs(length, currentLen + 1, current + ('a' + adder).toString(), adder + 1)
}
