n = int(input())


def dfs(n, s):
    l = len(s)
    if n == l:
        print(s)
        return
    alpha = "abcdefghijklmnopqrstuvwxyz"
    for i in range(l + 1):
        dfs(n, s + alpha[i])


dfs(n, "")

