N = int(input())

def func(n):
  if n <= 1:
    return ["a"]
  S = []
  for i in func[n - 1]:
    S.append("a" + i)
    
    for j in range(len(i)):
      if i[j] == "a":
        i[j] = "b"
      elif i[j] == "b":
        i[j] = "a"
    
    S.append("a" + i)
    
  return S
 
Ans = .sort(func(N))

for i in Ans:
  print(i)
  