n = int(input())


A = ['a']

for i in range(n-1):
    B = A[i:]
    for j in B:
        # A.append("".join(j) + j[-1])
        # A.append("".join(j) + chr(ord(j[-1]) + 1))
        for i in range(ord("a"), ord(j[-1]) + 2):
            A.append("".join(j) + chr(i))
A = sorted(A)
for i in A:
    if len(i) == n:
        print(i)
