N = gets.to_i

ANS = []

CHARS = %w(a b c d e f g h i j k l)

def dfs(x, i)
  if x.length == N
    ANS << x
    return
  end

  dfs(x + CHARS[i], i)
  dfs(x + CHARS[i+1], i + 1)
end

dfs('a', 0)

ANS.each{|a| puts a }