# require 'pry'
def calc(n,s = "a",pre = "a".unpack("C*")[0])
  if n == 0
    puts s
    return
  end
  ("a".unpack("C*")[0]).upto(pre + 1) do |t|
    calc(n - 1, s + [t].pack("C*"), t)
  end
end

N = gets.to_i
# binding.pry
calc(N-1)