import math

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

N = int(input())
S = [[""] * math.factorial(i+1) for i in range(10)]

for i in range(10):
  if i == 0:
    S[0][0] = al[0]
  else:
    cnt = 0
    for s in S[i-1]:
      for a in al[:i+1]:
        S[i][cnt] = s + a
        cnt += 1

res_S = S[N-1]
for s in res_S:
  print(s)
