def execute(instructions):
    """
    Execute instructions, return a tuple of accumulator and exit reason.
    """
    index = 0
    accumulator = 0
    list_of_pc = set()
    while True:
        if index in list_of_pc:
            return (accumulator, "cycle")
        if index == len(instructions):
            return (accumulator, "termination")

        list_of_pc.add(index)
        # print(f"index {index}")
        instruction = instructions[index]
        # print(f"instruction {instruction}")
        if instruction["operation"] == "nop":
            index += 1
            continue
        if instruction["operation"] == "acc":
            accumulator += instruction["argument"]
            index += 1
            continue
        if instruction["operation"] == "jmp":
            index += instruction["argument"]
            continue