Bobo has a tree of $n$ vertices numbered with $0, 1, \dots, (n - 1)$.
He subsequently adds $m$ edges between vertex $x_i$ and $\mathrm{LCA}(x_i, y_i)$
where $\mathrm{LCA}(x_i, y_i)$ is the vertex lying on the unique tree path between vertex $x_i$ and $y_i$ and closest to the vertex $0$.
Let the graph obtained by adding the edges $\{(x_1, \mathrm{LCA}(x_1, y_1)), (x_2, \mathrm{LCA}(x_2, y_2)), \dots, (x_i, \mathrm{LCA}(x_i, y_i))\}$ to the tree be $G_i$,
and $f_i(u)$ be the number of connected components after the removal of vertex $u$ from $G_i$.
Bobo knows that for $i \in \{0, 1, 2, \dots, m\}$
$$z_i = f_i(0) \oplus f_i(1) \oplus \dots \oplus f_i(n - 1).$$
($\oplus$ denotes xor.)
Given $a, b, x_0, y_0$, he also knows that for $i \in \{1, 2, \dots, m\}$,
* $x_i = (a \cdot x_{i - 1} + b \cdot y_{i - 1} + z_{i - 1}) \bmod n$,
* $y_i = (b \cdot x_{i - 1} + a \cdot y_{i - 1} + z_{i - 1}) \bmod n$.
Help him to find $x_m$, $y_m$.