import copy
n = int(input())

al = ['a', 'b', 'c' , 'd', 'e', 'f', 'g', 'h', 'i', 'j']
list = []
for i in range(n):
    if i ==0:
        list.append(al[0])
    else:
        lis = copy.deepcopy(list)
        for x in lis:
            flag = False
            for y in al[:i+1]:
                if y in x:
                    list.append(x+y)
                else:
                    if flag == False:
                        list.append(x+y)
                        flag = True

for x in list:
    print(x)