n = gets.to_i
chrs = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

l = ["a"]

for i in 1..n-1
  tmp = []
  l.each do |ll|
    for k in 0..i-1
      tmp << ll + chrs[k]
    end
  end
  tmp << l[-1] + chrs[i]
  l = tmp.dup
end

puts l.sort
