import itertools
N = int(input())

A = []
for i in range(N):
  if i == 0:
    A.append(())
  else:
    A += list(itertools.combinations(range(N-1),i))

ans = []
for a in A:
  s = 'a'
  if len(a) == 0:
    ans.append(s*N)
  else:
    tmp = ''
    cnt = 0
    for i in a:
      tmp += s*(i+1-cnt)
      cnt = i+1
      s = chr(ord(s)+1)
    if len(tmp) < N:
      tmp += s*(N-len(tmp))
    ans.append(tmp)
ans.sort()
for a in ans:
  print(a)