In the first line, there is an integer $T$ indicates the number of test cases.
For each case, the first line contains two integers $n,q$,the second line contains $n$ integers $A_1,A_2,\ldots,A_n$.
In the next $q$ lines,each line contains 2 intergers $a,b$.Query parameters $l,r$ are obtained from the numbers $a,b$.$l=\min((a \oplus la)\%n+1,(b \oplus la)\%n+1),r=\max((a \oplus la)\%n+1,(b \oplus la)\%n+1)$
The $\oplus$ means xor,and $la$ equals the response for the previous query.$la=0$ when each case begin.
$T\leq5,1\leq A_i,a,b\leq10^9$
In the $i$th case,$1\leq n,q\leq i\times10000$