import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 7)

import itertools

n = int(readline())
bit = [list(itertools.product([0, 1], repeat=(n - i))) for i in range(1, n)]
if n == 1:
    print('a')
    exit()
check = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']
for k in range(1, n):
    memo = ''
    for j in range(k):
        memo += check[j]
    for i in range(2 ** (n - k) - 1):
        ans = ''
        for j in range(n - k):
            if bit[k - 1][i][j] == 0:
                ans += check[k - 1]
            else:
                ans += check[k]
        print(memo + ans)
print(memo + check[n - 1])
