n = int(input())
ls = []
alphabet = [chr(i) for i in range(97, 97+26)]
alphabet_dict = {}
for i, a in enumerate(alphabet):
    alphabet_dict[a] = i
def dfs(A):
    if len(A) == n:
        ls.append(A)
        return
    l = alphabet_dict[A[-1]]
    for nex in [l-1,l,l+1]:
        if 0<= nex:
            A += alphabet[nex]
            dfs(A)
            A = A[:-1]
dfs('a')
ls.sort()
for i in range(len(ls)):
    print(ls[i])
    