n = gets.to_i
ans = []
(2**(n-1)).times do |i|
  s = "a"
  (n-1).times do |j|
    if i[j] == 0
      t = s[-1] == "a" ? "b" : "a"
      s << t
    else
      s << s[-1]
    end
  end
  ans << s
end
ans.sort!
puts ans.join("\n")