N = int(input())
seed = "a"
alpha = "abcdefghij"


def dfs(num, string):
    if num == 1:
        print(string)
    else:
        for i in range(num):
            dfs(num - 1, string + alpha[i])


dfs(N, "a")
