N = int(input())
s = "a"
ans = []
def dfs(s,n):
  if len(s) == n:
    ans.append(s)
    return
  last = ord(s[-1])
  limit = chr(last+1)
  for i in range(26):
    temp = chr(97+i)
    if temp <= limit:
      dfs(s+temp,n)
dfs(s,N)
print(*ans,sep="\n")