fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = "xabcdefghij"
    var ansList1 = mutableListOf<String>()
    ansList1.add("a")
    for (i in 2..n) {
        val ansList2 = mutableListOf<String>()
        for (ans in ansList1) {
            for (j in 1..i) {
                ansList2.add(ans + s[j])
            }
        }
        ansList1 = ansList2
    }
    val ansList = mutableListOf<String>()
    for (ans in ansList1) {
        var index = 0
        for (c in ans) {
            val ci = s.indexOf(c)
            if (index + 1 < ci) {
                index = -1
                break
            } else if (index + 1 == ci) {
                index++
            }
        }
        if (index >= 0) ansList.add(ans)
    }
    ansList.forEach { println(it) }
}