N = [int(i) for i in input().split()][0]
ordA = ord("a")

def recursion(x, k, c, words):
  if k == 0:
    words.append(x)
    return
  for i in range(c+2):
    recursion(x+chr(ordA+i), k-1, i, words) 
  
words = []
recursion("a", N - 1, 0, words)
for word in words:
  print(word)
    

