import itertools
n = int(input())
l = [0 for i in range(n)]
def print_from_l(l):
    print(''.join(map(lambda s:chr(97+s), l)))
for s in itertools.product(range(n), repeat=n):
    isValid = True
    if s[0] > 0:
        isValid = False
    for i in range(1, len(s)):
        if s[i] - s[i-1] > 1:
            isValid = False
    if isValid:
        print_from_l(s)