n = int(input())
s = []
alp = ['a' ,'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']

def print_a(n, ind, cnt, s):
  s = s + [alp[ind]]
  if cnt==n-1:
    for i in range(n):
    	print(s[i], end='')
    print()
  else:
    print_a(n, ind, cnt+1, s.copy())
    print_a(n, ind+1, cnt+1, s.copy())

print_a(n, 0, 0, s)