STR = "abcdefghijklmnopqrstuvwxyz"
def dfs(n, depth, kind, s)
  if depth >= n
    puts s
    return
  end
  (kind + 1).times do |i|
    dfs(n, depth + 1, i + 1, s + STR[i])
  end
end

n = gets.to_i
dfs(n, 0, 0, "")
