from string import ascii_lowercase as alph

def gen_pattern(N, pre=""):
  for c in alp[:(ord(max(pre or "\x60"))-0x5f]:
    pattern = pre+c
    if len(pattern) == N:
      yield pattern
    else:
      yield from gen_pattern(N, pattern)

for pattern in gen_pattern(int(input())):
  print(pattern)
