import sys
from itertools import combinations_with_replacement
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N = int(read())
acc = 0

for comb in combinations_with_replacement(range(N), N):
    flag = True
    for i in range(N):
        if comb[i] > i:
            flag = False
    if flag:
        print(''.join([chr(97 + i) for i in comb]))
