import string
import copy
def dfs(n):
    if n == N:
        tmp = copy.deepcopy(nlst)
        if nlst[0] != 0:
            anslst.append(tmp)
        return
    for i in range(2):
        nlst[n] = i
        dfs(n + 1)
    return


N = int(input())
anslst = []
nlst = [0] * N
wordlst = string.ascii_lowercase
dfs(0)
wlst = []
for i in anslst:
    index = 0
    w = ''
    for j in i:
        if j == 1:
            w += 'a'
        else:
            w += wordlst[1 + index]
            index += 1
    wlst.append(w)

wlst.sort()
for i in wlst:
    print(i)