fun main(args: Array<String>) {
  val N = readInt()

  val S = (1..N).map { 'a' }.toMutableList()
  fun f(n: Int, d: Int) {
    if (n < N) {
      for (i in 1..d) {
        S[n] = 'a' + i - 1
        f(n + 1, i + 1)
      }
    } else {
      println(S.joinToString(""))
    }
  }
  f(1, 2)

}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readInts() = readStrings().map(Integer::parseInt)
fun readLong() = readString().toLong()
fun readLongs() = readStrings().map { it.toLong() }
