def create_li(li):
  if len(li) >= n:
    lis.append(li)
    return
  p = li[-1]
  ret = []
  for i in range(1, p + 2):
    cp = li[:]
    cp.append(i)
 #   print(cp)
    create_li(cp)

lis = []
  
n = int(input())
pre = [1]
create_li(pre)
lis.sort()
al = ["a","b","c","d","e","f","g","h","i","j"]
ans = set(["".join([al[id-1] for id in i]) for i in lis])
ans = list(ans)
ans.sort()
for i in ans:
  print(i)