import java.util.*

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