N = int(input())
alphabet_list = [chr(i) for i in range(97, 97 + N)]

import collections

previous_list = ["a"]
for i in range(1, N):
    out_list = []
    for a in previous_list:
        # print(len(collections.Counter(a)))
        for al in alphabet_list[:len(collections.Counter(a))+2]:
            # print(a + al)
            out_list.append(a+al)
    previous_list = out_list

for out in previous_list:
    print(out)