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){
		arr.map(::char).forEach(::print)
		println()
		return
	}
	val newArr = arr.clone()
	for (i in 0 .. m+1){
		newArr[n+1] = i
		recC(newArr, n+1, Math.max(m, i))
	}
}

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