Statement
Statement language
You are given a sequence and an integer . For each , consider the minimum of the consecutive elements .
The sequence is generated rather than provided directly. For every ,
The values are given in the input.
Input
The input is given in the following format:
Output
For each case, let for . Print on one line, where denotes bitwise XOR.
Constraints
- .
- .
Subtasks
Samples
Input
2
5 3
1 1 1 10
4 1
1 1 1 10
Output
5
0