N = int(input())

def standard(n, cur):
  if n == 0:
    print(''.join(cur))
  else:
    c = ord(cur[-1]) - ord('a') + 1
    for i in range(c + 1):
      standard(n - 1, cur + [chr(ord('a') + i)])

standard(N - 1, ['a'])