import sys

#a=0 b=1 ...
def chr2idx(c):
    return ord(c)-ord("a")
def idx2chr(x):
    return chr(ord("a")+x)

N=int(input())
ar=["a"]
if N==1:
    print("a")
    sys.exit()

for i in range(N-1):
    new_ar=[]
    L=len(ar)
    for j in range(L):
        for k in range(chr2idx(ar[j][-1])+2):
            new_ar+=[ar[j]+idx2chr(k)]
    ar=new_ar[:]

L=len(ar)
for i in range(L):
    print(ar[i])