N = gets.to_i

strs = (0..N).map{ [] }
strs[0] = [""]

Chars = [""] + "abcdefghijklmn".split("")
N.times{
  (0...N).reverse_each{ |i|
    ss = strs[i]
    strs[i] = (1..i).flat_map{ |j| ss.map{ |s| s + Chars[j] } }
    strs[i+1] += ss.map{ |s| s + Chars[i+1] }
  }
}

puts strs[1..-1]
