hello i tried solving the following problem using fermat little theoreme but had difficulties advancing , perhaps i'm not aware of some necessary theorems :

We write on a board all the natural numbers from 1 to 500 .We arbitrarily chose two , three, four or five numbers then we erase them and replace them by the remainder of the euclidian division of their sum by 13. In the following step , we do the same thing with a new list of natural numbers remaining on the board . we repeat this process many times.

After a particular number of steps , only two numbers stay written on the board , one of them is 102. FIND THE OTHER NUMBER

i couldn't solve this problem so if anyone got some advice or help i would be very grateful.