import itertools as iters

def enlong(s):
    l = s[-1] + 1
    return [s + [i] for i in range(1,l+1)]

N = int(input())
alpha = "abcdefghijk"
R = [[1]]
for _ in range(N-1):
    S = []
    for r in R:
        S += enlong(r)
    R = S[::]
for r in R:
    s = "".join([alpha[ss-1] for ss in r])
    print(s)
