n = $stdin.readline.to_i

def normal_form(n)
  if n < 2
    return ["a"]
  else
    res = []
    nf = normal_form(n - 1)
    nf.each do |s|
      ("a"..(s[-1].ord + 1).chr).each do |c|
        res << s + c
      end
    end
    return res
  end
end

puts normal_form(n).sort!