import itertools
n = int(input())
l = [i for i in range(1, n+1)]
alpha_dict = {}
for i,c in enumerate(range(ord('A'),ord('Z')+1)):
  alpha_dict[i+1] = chr(c)

ans = set()
for v in itertools.combinations_with_replacement(l, n):
  m = min(v)
  diff = m - 1 
  tmp = ""
  num = m-diff 
  for n in v:
    if n-diff != num:
      num += 1
    tmp += str(alpha_dict[num].lower()) 
  ans.add(tmp)

ans = sorted(list(ans))
for v in ans:
  print(v)

