import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.StringBuilder
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)
    val n = sc.nextInt()
    val set = mutableSetOf<String>()
    val i1 = 0
    val j2 = 0
    for (i2 in 0..j2 + 1) {
        val j3 = Math.max(i1, i2)
        for (i3 in 0..j3 + 1) {
            val j4 = Math.max(j3, i3)
            for (i4 in 0..j4 + 1) {
                val j5 = Math.max(j4, i4)
                for (i5 in 0..j5 + 1) {
                    val j6 = Math.max(j5, i5)
                    for (i6 in 0..j6 + 1) {
                        val j7 = Math.max(j6, i6)
                        for (i7 in 0..j7 + 1) {
                            val j8 = Math.max(j7, i7)
                            for (i8 in 0..j8 + 1) {
                                val j9 = Math.max(j8, i8)
                                for (i9 in 0..j9 + 1) {
                                    val j10 = Math.max(j9, i9)
                                    for (i10 in 0..j10 + 1) {
                                        val arr = arrayOf(i1, i2, i3, i4, i5, i6, i7, i8, i9, i10)
                                        val sb = StringBuilder()
                                        for (j in 0 until n) {
                                            sb.append('a' + arr[j])
                                        }
                                        set.add(sb.toString())
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    for (s in set.sorted()) {
        println(s)
    }
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}
