P7121 Ame and Gura’s Wonderful Adventure.
Background
#### Since Luogu’s SPJ compilation may depend on the compiler version chosen by the user, and the SPJ uses C++11, C++ users should submit with C++11 or higher.
~~Lewdson~~ Watson Amelia and Gawr Gura are playing Mivicraft.
Gura wants to upgrade the transportation in the Nether into ice-boat tunnels, but before that she needs a pickaxe with Silk Touch. After trying again and again but still failing, she could only go to Ame pitifully. Ame immediately said: “So easy! I'll get it in my first try.”
(After the first time) “Well let's try it again!”
(After the second time) “Hmmm maybe something's getting wrong today?”
(After the third time) “I'll give you a ground pound you silly enchanting table!”
(After the fourth time) “.. Damn.”
So Ame decided to use some “techniques” to get a Silk Touch pickaxe. By looking up information, she learned that Mivicraft uses the Mersenne Twister algorithm (MT19937) to generate random numbers. Mivicraft uses an MT19937 engine to generate a sequence of random numbers to generate world chunks.
Description
Ame knows that as long as she can find the seed used to initialize the MT19937 engine, she can figure out how to obtain a Silk Touch pickaxe. So she traveled around the world, and with her clever detective mind, she worked out the first $N$ random numbers generated **right after the MT19937 engine was initialized** (note: here $N$ is a parameter in the MT19937 engine). Now she gives you these $N$ random numbers, hoping that you can deduce the seed used to initialize the MT19937 engine ($0\le\text{seed}
Input Format
The first line contains 10 non-negative integers, corresponding to the 10 parameters in MT19937: $N$, $M$, $A$, $U$, $S$, $B$, $T$, $C$, $L$, and $F$.
The next $N$ lines each contain one non-negative integer, representing in order the $N$ random numbers generated right after the MT19937 engine was initialized.
Output Format
Output one non-negative integer in a single line, representing the seed used when initializing the MT19937 engine. The testdata guarantees that there is a solution. If there are multiple solutions, you only need to output any one of them.
Explanation/Hint
### Sample Explanation #1
All 10 parameters use the standard MT19937 parameters, and the seed is `233333`. That is, you can generate the same random number sequence with the following program:
```cpp
#include
#include
std::mt19937 engine(233333);
int main() {
for (int i = 0; i < 624; ++i)
std::cout