N = int(input())
l = set()

for i in range(N**2):
  pattern = [True] * N
  
  for j in range(N):
    if ((i>>j) & 1):
      pattern[j] = False
   
  o = ord('a')
  t = ''
  for n in range(N):
    if pattern[n]:
      t += 'a'
    else:
      t += chr(o)
      o += 1
      
  l.add(t)
  
l = list(l)  
l.sort()

for ans in l:
  print(ans)