import copy
n = int(input())

def dfs(str_list, now):
    str_list.append(chr(now))
    if len(str_list) == n:
        print(''.join(str_list))
    else:
        chr_a = ord('a')
        for c in range(chr_a, now + 2, 1):
            str_list_cp = copy.deepcopy(str_list)
            dfs(str_list_cp, c)

dfs([], ord('a'))