l = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']

#print([chr(i) for i in range(97, 97+26)])

def adder(n, s, index):
    if (n == 0):
        print(s)
    else:
        #if(n == 1):
        for i in range(index +2):
            adder(n-1, s+l[i],i)


n = int(input())
#base =
if (n == 1):
    print("a")
elif (n == 2):
    print("aa")
    print("ab")
else:
    adder(n-1,"a",0)

