N = gets.to_i
$str_memo = %w(a b c d e f g h i j)
# $ans = []
def rec(array)
  if array.size == N
    puts array.join("")
    return
  end
  (array.size + 1).times do |i|
    rec(array + [$str_memo[i]])
  end
end
rec([])
# $ans.each do |a|
#   puts a.join("")
# end
