def resolve():
    n = int(input())
    alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
    strlist =[[]*10 for _ in range(n)]
    strlist[0] = ["0"]
    for i in range(1,n):
        for j in range(int(len(strlist[i-1]))):
            test = str(strlist[i-1][j])
            add = 0
            while add <= int(test[-1])+1:
                strlist[i].append(test + str(add))
                add += 1
    ans = strlist[n-1]
    for i in range(len(ans)):
        output = []
        for j in range(len(ans[0])):
            output.append(alphabet[int(ans[i][j])])
        print("".join(output))
resolve()