#abc185f. [abc185_f]Range Xor Query
[abc185_f]Range Xor Query
Problem Statement
We have an integer sequence of length .
You will process queries on this sequence. In the -th query, given values , , and , do the following:
- If , replace with .
- If , print $A_{X_i} \\oplus A_{X_i + 1} \\oplus A_{X_i + 2} \\oplus \\dots \\oplus A_{Y_i}$.
Here, denotes the bitwise XOR of and .
What is bitwise XOR?
The bitwise XOR of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if either or , but not both, has in the 's place, and otherwise.
For example, . (In base two: .)
Constraints
- is or .
- If , then and .
- If , then .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
$A_1 \\hspace{7pt} A_2 \\hspace{7pt} A_3 \\hspace{5pt} \\dots \\hspace{5pt} A_N$
Output
For each query with in the order received, print the response in its own line.
Sample Input 1
3 4
1 2 3
2 1 3
2 2 3
1 2 3
2 2 3
Sample Output 1
0
1
2
In the first query, we print .
In the second query, we print .
In the third query, we replace with .
In the fourth query, we print .
Sample Input 2
10 10
0 5 3 4 7 0 0 0 1 0
1 10 7
2 8 9
2 3 6
2 1 6
2 1 10
1 9 4
1 6 1
1 6 3
1 1 7
2 3 5
Sample Output 2
1
0
5
3
0