Artificial intelligent assistant

Erasing numbers from circle and writing down sum There are $50$ copies of the number $1$, and $50$ copies of the number $-1$, written _alternately_ in a circle. In each step, we pick an arbitrary number, write down the sum of the number and its two neighbors on another piece of paper, and erase that number. We do this until there are only $2$ numbers left. Prove that we will write down an even number of positive numbers. I can show that for one particular sequence of erasing, the statement is true. If we erase the numbers consecutively $1,-1,1,-1,\ldots$, we always write down the number $-1$, which means we write down an even number (i.e., none) of positive numbers. How can this be extended to an arbitrary sequence of erasing?

Generalization: any number of $1$s and $-1$s are written in a circle in any order, and the same steps are performed. We claim that the number of positive numbers written down has the same parity as the number of pairs of consecutive $1$s in the original circle. (For example, if there are four $1$s in a row flanked by $-1$s, that counts as three pairs of consecutive $1$s.)

The generalization is easy to prove inductively, since the only moves that change the number of pairs of consecutive $1$s are to remove a $-1$ that's between two $1$s or to remove a $1$ that has a $1$ as a neighbor, both of which result in writing a positive number down.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f7e2f1773b4b4f18192c91547be477cd