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))
A = sorted(A)
for i in A:
    if len(i) == n:
        print(i)