

#include
#include
#include
#include
#include
#include
For a series FF:
\displaystyle \begin{gathered} F(0) = 0,F(1) = 1\\ F(n) = 3*F(n-1)+2*F(n-2),(n \geq 2) \end{gathered}F(0)=0,F(1)=1F(n)=3∗F(n−1)+2∗F(n−2),(n≥2)
We have some queries. For each query NN, the answer AA is the value F(N)F(N) modulo 998244353998244353.
Moreover, the input data is given in the form of encryption, only the number of queries QQ and the first query N_1N1are given. For the others, the query N_i(2\leq i\leq Q)Ni(2≤i≤Q) is defined as the xor of the previous N_{i-1}Ni−1 and the square of the previous answer A_{i-1}Ai−1. For example, if the first query N_1N1 is 22, the answer A_1A1 is 33, then the second query N_2N2 is 2 \ xor \ ( 3*3)=112 xor (3∗3)=11.
Finally, you don't need to output all the answers for every query, you just need to output the xor of each query's answer A_1\ xor\ A_2 ... xor\ A_QA1 xor A2...xor AQ.
Input
The input contains two integers, Q, NQ,N, 1\ \leq \ Q \leq 10^7,0\ \leq\ N \leq 10^{18}1 ≤ Q≤107,0 ≤ N≤1018. QQ representing the number of queries and NN representing the first query.
Output:
An integer representing the final answer.