local mmi, mma = math.min, math.max

n = io.read("*n")
local curmax = 0
local curlen = 0
local t = {}
local function dump()
  for i = 1, n do
    io.write(string.char(t[i] + 96))
  end
  io.write("\n")
end

local function dfs()
  if curlen == n then
    dump()
  else
    curlen = curlen + 1
    local premax = curmax
    for i = 1, curmax + 1 do
      t[curlen] = i
      curmax = mma(i, premax)
      dfs()
      curmax = premax
    end
    curlen = curlen - 1
  end
end
dfs()
