from collections import deque
n=int(input())
al=[chr(ord('a') + i) for i in range(26)]
norm=defaultdict(list)
for i in range(11):
  if i==0:
    norm[1]=['a']
  else:
    for char in norm[i-1]:
      last=char[-1]
      range_digit=al.index(last)+2
      for s in al[0:range_digit]:
        norm[i].append(char+s)

for char in norm[n]:
  print(char)