N = int(input())

w = ["a"]
l = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]

for i in range(N - 1):
  w_init = w
  w = []
  for j in range(len(w_init)):
    for k in range(i + 2):
      if w_init[j][-1] == l[k]:
        for m in range(k + 2):
          w.append(w_init[j] + l[m])

for i in range(len(w)):
  print(w[i])
