The first line contains a single integer $T(1 \leq T \leq 30)$ , the number of test cases.
For each test case, the first line gives three integers $n$, $m$ and $q$ ($1 \leq n,m,q \leq 10^6$). $n$ is the length of string $S$, each character $S_i$ $\in$ $[1,m]$ and $q$ is the number of questions.
The next line gives the string $S$ that consists of $n$ positive integers which are in $[1,m]$.
Each of the following $q$ lines consists of three integers $t,c,i(1 \leq t \leq 2,1 \leq c \leq m,1 \leq i \leq n+1)$, representing the type of this question is $1$ if $t=1$ and $2$ if $t=2$.
Note that $c$ and $i$ is encrypted. Assuming $last$ is the previous query answer, the actual values of $c$ and $i$ are $c \oplus last$ and $i \oplus last$ ($\oplus$ denotes the exclusive or operation). For the first query , $last = 0$.
It is guaranteed that both $\sum$ $n$ and $\sum$ $q$ don't exceed $3 \times 10^6$.