import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)
    val n = sc.nextInt()

    dfs(n, LinkedList<Char>())

}

fun dfs(n: Int, res: LinkedList<Char>) {
    if(res.size == n) {
        println(res.joinToString(""))
        return
    }
    for (c in 'a'..'z') {
        if(res.size == 0 && c > 'a') continue
        else if(res.size > 0 && c - res.last() > 1) continue

        res.add(c)
        dfs(n, res)
        res.pollLast()
    }
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}