val ss = sortedSetOf<String>()
fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  dfs("a", n)
  ss.forEach { println(it) }
}
fun dfs(s: String, n: Int) {
  val v = s[s.length-1].toInt()-97
  for (i in 0..v+1) {
    val t = s+(i+97).toChar()
    if (t.length == n) ss.add(t) else dfs(t, n)
  }
}