
N = int(input())
 
def func(n):
  if n <= 1:
    return ["a"]
  S = []
  for i in func(n - 1):
    S.append("a" + i)
    S.append("a" + i.replace("a","x").replace("b","a").replace("x","b"))
    
  return S
 
Ans = func(N)

Ans = list(set(Ans))
Ans.sort()
for i in Ans:
  print(i)