N=int(input())
S='abcdefghijklmnopqrstuvwxyz'
A=['a']
for _ in range(N-1):
    now=[]
    for a in A:
        b=S.index(a[-1])+1
        for i in range(b+1):
            now.append(a+S[i])
    A=now.copy()
A.sort()
for a in A:
    print(a)