from itertools import product, combinations_with_replacement
N=int(input())
s="abcdefghij"

def get_gen(a, N):
  for c in s[:s.index(max(a))+2]:
    t = a+c
    if len(t) == N:
      print(t)
    else:
      get_gen(t,N)
get_gen("a", N)