import itertools as iters

N = int(input())
alpha = "abcdefghijk"
S = [list(range(1,n+2)) for n in range(N)]

for s in iters.product(*S):
    #print(s)
    r = [alpha[ss-1] for ss in s]
    print("".join(r))