import sys
n=int(input())

a=ord('a')
w=[]
for i in range(n):
    w.append(chr(a))
if n==1:
    print('a')
    sys.exit()
if n==2:
    for i in range(n):
        w[-1]=chr(a+i)
        print(''.join(w))

def dd(i,j,n):
    if n>j:
        if (i-j)<0:
            w[-j]=chr(a)
        else:
            w[-j]=chr(a+(i-j))
        dd(i,j+1,n)

for i in range(3,n+1):
    if n>3:
        dd(i,3,n)
    for j in range(1,i):
        if n>2:
            w[-2]=chr(a+(j-1))
        for k in range(j+1):
            if n>1:
                w[-1]=chr(a+k)
                print(''.join(w))