import sys
sys.setrecursionlimit(5000000)
N = int(input())
ans = []


def func(s):
    if len(s) == N:
        ans.append(s)
    else:
        func(s+chr(ord(s[-1])+1))
        func(s+s[-1])


func('a')
for a in sorted(ans):
    print(a)
