from collections import defaultdict


class Graph:
    def __init__(self) -> None:
        self.graph = defaultdict(list)

    def connect(self, u, v):
        self.graph[u].append(v)

    def dfs(self, start):
        return list(self._dfs(start))

    def _dfs(self, node):
        if self.graph.get(node) is None:
            yield [node]
        else:
            for child in self.graph[node]:
                for path in self._dfs(child):
                    yield [node] + path


n = int(input())
g = Graph()
for level in range(n - 1):
    for j in range(level + 1):
        for k in range(j + 2):
            g.connect((level, j), (level + 1, k))

paths = g.dfs((0, 0))
for path in paths:
    print(''.join([chr(ord('a') + i) for level, i in path]))
