N = int(input())

def standard_string(N, st):
  if st = "":
    standard_string(N, "a")
  if len(st) == N:
    print(st)
    return 
  for i in range(97, ord(st[-1])+ 1):
    st += char(i)
    standard_string(N, st)
    st = st[:-1]
standard_string(N, "")