S = "abcdefghijklmn"


def calc(depth, a, ans):
    if 0 < depth:
        for i in range(a + 2):
            calc(depth - 1, i, ans + S[i])
    else:
        print(ans)
        return


def main():

    N = int(input())

    calc(N, -1, "")


main()
