from itertools import combinations_with_replacement as cb

N = int(input())
al = [chr(i) for i in range(97, 97 + 26)]

ans = []
for C in cb(al[:N], N):
    if C[0] != 'a': continue
    X = set(C)
    flag = True
    for i in range(len(X)):
        if chr(i + 97) not in X:
            flag = False
    if flag:
        ans.append(''.join(C))
ans.sort()
print(*ans, sep='\n')