import java.util.*

fun dfs(n : Int, s : String, mx : Char) {
    if (s.length == n) {
        println(s)
    } else {
        for (next in 'a'..(mx+1)) {
            dfs(n, s + next, next)
        }
    }
}
fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()
    dfs(n, "a", 'a')
}