The Mersenne Twister (MT) is a non-cryptographic pseudorandom number generator (PRNG). Its goal is to generate uniformly random numbers in the range $[0,2^{32}-1]$ or $[0,2^{64}-1]$. However, unlike cryptographic pseudorandom generators, MT does not provide forward or backward resistance. The detailed algorithm description can be found on this page.
We focus on the version of MT that produces pseudorandom integers of length $32$ bits. As explained on this page, MT keeps $624$ $32$-bit integers as its internal states. To generate randomnesses, the algorithm simply computes a linear combination of $3$ out of $624$ integers in a fixed order. Although the states are constantly updated when invoking MT, the future states can be predicted if previous states are exposed.
In this challenge, you will be given some random numbers generated by a MT. Your goal is to recover all the states and predict the next pseudorandom number that will be generated from this MT.
When you get the answer $r$, validate it by solve
.