# import bisect
# # import heapq
# # from copy import deepcopy
# # from collections import deque
# # from collections import Counter
# # from itertools import accumulate
# # from itertools import permutations
# import numpy as np
# # import math
# a,b,c = map(int, input().split())
n = int(input())
# p = list(map(int, input().split()))
lis = []

def dfs(s, var):
    if len(s) == n and s not in lis:
        lis.append(s)
    else:
        for i in range(var):
            dfs(s+chr(ord('a')+i), var)

        dfs(s+chr(ord('a')+var), var+1)


dfs('a', 1)
lis.sort()
for i in range(len(lis)):
    print(lis[i])