N = int(input())
from collections import deque

def func(S):
  q = deque([S])
  while q:
    x = q.popleft()
    if len(x) == N:
      print(x)
    else:
      #許容される文字の数=aの数
      len_a = list( i for i in x ).count('a')
      for char_no in range(ord('a'), max([ ord(i) for i in x ])+2):
        if char_no == ord('a'):
          y = x + chr(char_no)
          q.append(y)
        elif len_a <= list( i for i in x ).count(chr(char_no)):
          pass
        else:
          y = x + chr(char_no)
          q.append(y)


start = 'a'
func(start)