N = int(input())
import itertools
from collections import deque
ans = deque()
l = []
for i in range(N):
  l.append(chr(97+i))
  for x in itertools.product(l, repeat=N):
    f = [0]*10
    x = list(x)
    judge = True
    k = False
    for w in x:
      w = ord(w)-97
      f[w]=1
      if w==0:
        continue
      elif f[w-1]==1:
        continue
      else:
        k = True
        
    if k:
      continue
    else:
      ans.append(''.join(x))
ans = set(ans)
ans = sorted(list(ans))
for a in ans:
  print(a)