n = int(input())
ans = []
def all_search(array):
    if len(array) == n:
        ans.append(array)
    else:
        for i in range(len(array) + 1):
            res = array + chr(i + ord('a'))
            all_search(res)
all_search("")
for i in range(len(ans)):
    print(ans[i])
