N = int(input())

chars = [chr(i) for i in range(ord('a'), ord('z')+1)]

ans = []

def dfs(s):
    if len(s) == N:
        # print(s)
        ans.append(s)
        return
    
    end = s[-1]
    end_i = chars.index(end)
    for i in range(end_i + 2):
        ns = s + chars[i]
        # print('-', i, ns)
        dfs(ns)

dfs('a')


ans.sort()
for si in ans:
    print(si)