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
    }
    dfs(length, currentLen + 1, current + "a", adder)
    dfs(length, currentLen + 1, current + ('a' + adder).toString(), adder + 1)
}
