N = int(input())

alp = "abcdefghijklmnopqrstuvwxyz"

def dfs(s):
    i = len(s)
    if i == N:
        print(s)
    else:
        index = alp.index(s[-1])
        for i in range(index+2):
            dfs(s+alp[i])

dfs("a")