n = int(input())
a = ord('a')

def f(x: int) -> str:
  return chr(x + a)

for i in range(2 * 10 ** (n-2)):
  x = list(map(int, str(i).zfill(n)))
  maximum = 0
  flag = True
  for y in x[1:]:
    if y > maximum + 1:
      flag = False
      break
    elif y == maximum + 1:
      maximum = y
  if flag:
    print(''.join(map(f, x)))