private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map(String::toInt) // list of ints
private fun readLongs() = readStrings().map(String::toLong) // list of longs

var n: Int = 0

fun main(args: Array<String>) {
    n = readInt()
    val a = listOf('a')

    f(a)
}

fun f(list: List<Char>) {
    if (list.size >= n) {
        println(list.joinToString(""))
        return
    }
    ('a'..list.last().inc()).map { c -> list.asSequence().plus(c).toList() }.forEach(::f)
}
