import java.util.*

fun rec(n: Int, s: String, used: Char) {

    if (s.length == n) {
        println(s)
        return
    }

    for (i in 'a'..used) {
        rec(n, s + i, used)
    }
    if (used < 'z') {
        rec(n, s + (used + 1), used + 1)
    }
}

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    rec(n, "", 'a' - 1)
}