N = int(input())

my_list = []
for i in range(N):
    if i == 0:
        my_list.append("a")
        continue
    new_list = []
    while my_list:
        s = my_list.pop(0)
        for j in range(ord("a"), ord(s[-1]) + 2):
            new_list.append(s + chr(j))
    my_list += new_list

[print(s) for s in my_list]
