N = int(input())

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

ans = []

# mx: 現時点でのmax
def dfs(s, mx):
    print(':', s, mx)
    if len(s) == N:
        # print(s)
        ans.append(s)
        return
    
    for i in range(mx + 2):
        ns = s + chars[i]
        if i == mx + 1:
            nmx = i
        else:
            nmx = mx
        dfs(ns, nmx)

dfs('a', 0)


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