Steve has an integer array $a$ of length $n$ (1-based). He assigned all the elements as zero at the beginning. After that, he made $m$ operations, each of which is to update an interval of $a$ with some value. You need to figure out $\bigoplus_{i = 1}^{n}{(i \cdot a_i)}$ after all his operations are finished, where $\bigoplus$ means the bitwise exclusive-OR operator.
In order to avoid huge input data, these operations are encrypted through some particular approach.
There are three unsigned 32-bit integers $X, Y$ and $Z$ which have initial values given by the input. A random number generator function is described as following, where $\wedge$ means the bitwise exclusive-OR operator, $< <$ means the bitwise left shift operator and $> >$ means the bitwise right shift operator. Note that function would change the values of $X, Y$ and $Z$ after calling.
Let the $i$-th result value of calling the above function as $f_i$ $(i = 1, 2, \cdots, 3 m)$. The $i$-th operation of Steve is to update $a_j$ as $v_i$ if $a_j < v_i$ $(j = l_i, l_i + 1, \cdots, r_i)$, where
$$\begin{cases} l_i &= \min\left((f_{3 i - 2} \bmod n) + 1, (f_{3 i - 1} \bmod n) + 1\right) \\ r_i &= \max\left((f_{3 i - 2} \bmod n) + 1, (f_{3 i - 1} \bmod n) + 1\right) \\ v_i &= f_{3 i} \bmod 2^{30}\end{cases} (i = 1, 2, \cdots, m).$$