=begin
N
=end
N = gets.chomp.to_i

S = "abcdefghij".each_char.to_a

def rec(a, last, index)
  if index >= N
    s = a.map {|i| S[i] }.join
    puts s
  else
    for i in (0..(last + 1)) do
      rec(a + [i], i, index + 1)
    end
  end
end

rec([], -1, 0)
