from itertools import combinations
n = int(input())
l = [i for i in range(n)]
ans_list = []
for k in range(n, 1, -1):
    for comb in combinations(l, k):
        ans = ['z'] * n
        # print(comb)
        for i in comb:
            ans[i] = 'a'
        num = ord('a')
        for j in range(n):
            if ans[j] == 'z':
                ans[j] = chr(num+1)
                num += 1
        ans_list.append(''.join(ans))

alpha = 'abcdefghijklmn'
last = alpha[:n]
ans_list.append(last)
ans_list.sort()
for a in ans_list:
    print(a)

