n = int(input())
candidate = ['a']


def dfs(s, c):
    if len(s) == n:
        return
    candidate.append(s + c)
    candidate.append(s + chr(ord(c) + 1))
    dfs(s + c, c)
    dfs(s + chr(ord(c) + 1), chr(ord(c) + 1))


dfs('a', 'a')

for c in candidate:
    if len(c) == n:
        print(c)
