import sys
sys.setrecursionlimit(10**7)
N = int(input())
N -= 1

S = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"]


def dfs(s, depth, maxS):

    if depth == N:
        print(s)
        return

    for i in range(maxS+1):
        dfs(s + S[i], depth+1, i+1)


dfs("a", 0, 1)
