import java.util.*

val out = ArrayList<String>()
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val a = ArrayList<Char>()
    a.add('a')
    go(1, a, n)
    println(out.joinToString("\n"))
}

fun go(current: Int, a: ArrayList<Char>, n: Int) {
    if (a.size == n) {
        out.add(a.joinToString(""))
        return
    }

    val next: Char = a.last() + 1
    for (i in 'a' .. next) {
        a.add(i)
        go(current + 1, a, n)
        a.removeAt(a.lastIndex)
    }
}