n=gets.to_i
c=[]
n.times do |s|
  [*1..n-1].combination(s) do |l|
    s=""
    i=0
    lll=0
    l.each do |ll|
      s << (97+i).chr*(ll-lll)
      lll=ll
      i+=1
    end
    s << (97+i).chr*(n-lll)
    c << s
  end
end
puts c.sort