N = int(input())

lst = []

d = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j']


def dfs(s, n):
    lst.append(s)
    if n == N:
        return
    else:
        for i in range(n + 1):
            dfs(s + d[i], n + 1)


dfs('a', 1)
for i in range(len(lst)):
    if len(lst[i]) == N:
        print(lst[i])