P10818 [EC Final 2020] Random Shuffle
Description
Prof. Pang is selecting teams that advance to the world final contest. As the regionals are cancelled, he uses random shuffle to rank the teams. There are $n$ teams in total. His code is as follows:
```cpp
uint64_t x;//uint64_t represents 64-bit unsigned integer
int n;
uint64_t rand() {//this is a xor-shift random generator
x ^= x > 7;
x ^= x > n;
cin >> x;
for (int i = 1; i
Input Format
The first line contains a single integer $n$ ($50\le n\le 100000$) -- the number of teams.
The next line contains $n$ integers -- the result printed by Prof. Pang's code. It is guaranteed that the result is correct, i.e., there exists an integer $x$ ($0\le x\le 2^{64}-1$) that leads to the result.
Output Format
Output the integer $x$ ($0\le x\le 2^{64}-1$) Prof. Pang had entered. If there are multiple possible $x$'s, print any one.
Explanation/Hint
Note that the second line of the sample input is wrapped to fit in the width of page.