Robin has an array consisting of nonnegative integers. He wants to process queries. There are two types of queries:
- . Replace with . Here, represents the bitwise XOR operation.
- . Find the sum
Here, we define as follows:
Complete the functions xorQueries
which takes in an integer array and two integers and , and processes queries, returning the answers to all type- queries as an array. You need to take the query information from the standard input, as described in the input format section below.
Input Format
The first line contains three space-separated integers , and .
The second line contains space-separated integers .
The following lines describe the queries. The line describes the query in the format described in the problem statement, i.e., either or .
Constraints
Subtask
- For ~24% of the total score,
Output Format
For each type- query, print the answer for that query in a single line.
Sample Input 0
8 4 2
5 9 9 2 4 4 5 4
1 4 2
1 4 3
1 8 7
2 3 8
Sample Output 0
24
Explanation 0
The array is intially
- .
- .
- .
- .
- .
- .
Thus, the answer to the fourth query is .