require 'set'
l=["a","b","c","d","e","f","g","h","i","j"]
line = gets.chomp.to_i
a=Set.new
for i in 1..line
  b=l[0..i-1].combination(i).to_a
  c=[]
  for k in 0..line-i-1
    c.push("a")
  end
  for j in 0..b.length-1
    a.add?(c+b[j])
    a.add?(b[j]+c)
  end 
end
for m in a.to_a
  p m.join("")
end