n = gets.chomp.to_i
if n == 1
  puts 'a'
  exit
end
ans = []
alf = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
ans.push('a')
(n-1).times do
  next_ans = []
  ans.each do |a|
    l = a.split('').last
    ne = l.succ
    alf.each do |al|
      if ne >= al || a.split('').include?(al)
        next_ans.push(a + al)
      end
    end
  end
  ans = next_ans
end
ans.sort!
ans.each do |an|
  puts an
end
