from collections import deque
import sys
n = int(input())
if n == 1:
    print('a')
    sys.exit()

q = deque([])
q.append((1, '1', 1))
cur = 1
while cur != n:
    num = len(q)
    j = 0
    while j < num:
        a, b, c = q.popleft()
        for i in range(1, c+2):
            q.append((i, b + str(i), max(i, a)))
        j += 1
    cur += 1

d = dict()
for i in range(1, n+1):
    d[str(i)] = chr((i-1) + 97)

for i in range(len(q)):
    a, b, c = q.popleft()
    print(b.translate(str.maketrans(d)))
