import java.util.Scanner

fun main(args: Array<String>) {
	val scn = Scanner(System.`in`)
	val n = scn.nextInt()
	recC(IntArray(n), 0, 0)
}

fun recC(arr: IntArray, n: Int, m: Int){
	if (arr.lastIndex == n){
		println(buildString { arr.forEach {append(char(it))} })
		return
	}
	for (i in 0 .. m+1){
		arr[n+1] = i
		recC(arr, n+1, Math.max(m, i))
	}
}

fun char(n: Int) = 'a' + n