import java.util.*

fun main(args: Array<String>) {
    val result = solve(Scanner(System.`in`))
    if (result.isNotEmpty()) println(result)
}

fun solve(`in`: String) = solve(Scanner(`in`))


fun solve(sc: Scanner): String {
    val N = sc.nextInt()

    val result = mutableListOf<String>()
    fun f(n: Int, s: String) {
        if (n == N) {
            result.add(s)
            return
        }
        f(n + 1, s + s.last())
        f(n + 1, s + (s.last() + 1))
    }
    f(1, "a")

    return result.joinToString("\n")
}
