from itertools import permutations
from itertools import combinations

def main():
    N = int(input())
    word = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
        'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
        'v', 'w', 'x', 'y', 'z']
    cand = list()
    ans = []
    if N == 1:
        print('a')
        exit()
    if N == 2:
        print('aa')
        print('ab')
        exit()
    for i in range(N):
        for j in range(N):
            if i >= j:
                continue
            cand.append((i,j))
    cand.sort()
    ans = list()
    for i in range(1,N):
        for j in combinations(cand,i):
            words = ['z'] * N
            for m, n in j:
                words[m] = 'a'
                words[n] = 'a'
            ans.append(words)

    for n,m in enumerate(ans):
        for j, k in enumerate(m):
            if j == 0:
                pre = k
                if k != 'a':
                    ans[n][j] = 'a'
            else:
                if pre == k:
                    ans[n][j] = ans[n][j-1]
                else:
                    ans[n][j] = chr(ord(ans[n][j-1]) + 1)
                pre = k
    ans2 = set()
    for i in ans:
        tmp = ''.join(i)
        ans2.add(tmp)
    ans3 = list(ans2)
    ans3.sort()
    for j in ans3:
        print(j)

    


if __name__ == "__main__":
    main()