from sys import exit, setrecursionlimit
setrecursionlimit(10**6)

def array2D(row, col ,val=0):
    return [[val]*col for i in range(row)]

n = int(input())
t = [[1]]
for i in range(n-1):
    new_t = []
    for s in t:
        for j in range(len(s)):
            s_copy = s[:]
            s_copy[j] += 1
            s_copy.sort(reverse=True)
            if s_copy not in new_t:
                new_t.append(s_copy)
        s_copy = s+[1]
        s_copy.sort(reverse=True)
        if s_copy not in new_t:
            new_t.append(s_copy)
    t = [list(p) for p in new_t]

ans = []
for v in t:
    o = ord('a')
    str = ''
    for i in v:
        for j in range(i):
            str += chr(o)
        o += 1
    ans.append(str)
ans.sort()
print(*ans, sep='\n')