#153Easy
XOR queries
Time: 1 s · Memory: 256 MB
- Prefix sums
Statement
You are given non-negative integers and queries. For every query find , where is bitwise XOR.
Input format
The first line contains and (). The second line contains integers (). Each of the next lines contains a query: two integers and ().
Output format
For every query print one number on a separate line.
Examples
Input
8 4 3 2 4 5 1 1 5 3 2 4 5 6 1 8 3 3
Output
3 0 6 4
Note
XOR works with prefixes too, because : with the answer is — the common beginning cancels out. XOR plays the role of subtraction.
The first query of the example: .
Source: CSES, problem 1650.
