N = int(input())
ans = []
from string import ascii_letters
from itertools import combinations
for g in range(N):
    if g == 0:
        ans.append(ascii_letters[0]*N)
        continue
    for l in combinations(range(N-1), g):
        t = ""
        for i, v in enumerate(l):
            m = ascii_letters[i]
            if i == 0:
                n = l[i] + 1
            else:
                n = l[i] - l[i-1]
            t += (m * n)
        
        t += ascii_letters[i+1] * (N - len(t))
        ans.append(t)


for i in sorted(ans):
    print(i)
