N = int(input())

s = []

A = "abcdefghijklmnopqrstuvwxyz"

def ss(n):
    if n == 1:
        return [[0]]
    tt = ss(n-1)
    res = []
    for t in tt:
        for i in range(t[-1]+2):
            res.append(t + [i])
    return res

for s in ss(N):
    S = ''.join([A[i] for i in s])
    print(S)
