N = int(input())

def main(l):
  tmp = []
  for s in l:
    n = ord(s[-1])
    for i in range(97, n+2):
      tmp.append(s+chr(i))
  return tmp
  
l = ['a']
for i in range(1, N):
  l = main(l)
for i in range(len(l)):
  print(l[i])