import java.util.*
import kotlin.collections.ArrayList

fun main(args: Array<String>) {
    val scn = Scanner(System.`in`)
    var N = scn.nextInt()
    var list = arrayListOf("a","b","c","d","e","f","g","h","i","j")

    var ans0 = arrayListOf<String>("a")
    var ans1 = arrayListOf<String>()

    for (i in 2..N) {
        for (e in ans0) {
            var atOnce = false
            for (j in 1..i) {
                if (e.indexOf(list[j - 1]) == -1 && atOnce == false) {
                    atOnce = true
                    ans1.add(e + list[j - 1])
                }
                if (e.indexOf(list[j - 1]) != -1) {
                    ans1.add(e + list[j - 1])
                }
            }
        }
        ans0.clear()
        ans0 = ans1.clone() as ArrayList<String>
        ans1.clear()
    }

    ans0.sort()
    for(i in ans0)
        println(i)
}