def f(n, x)
  if n == 0
    puts x.map{|y| ('a'.ord+y).chr }.join
  else
    (0..(x.last+1)).each do |y|
      f(n - 1, [*x, y])
    end
  end
end


n = gets.to_i
if n == 1
  puts "a"
else
  f(n - 1, [0])
end