Find XOR on a segment#11285

Find XOR on a segment

1 second
128 megabytes
Very easy

The array is given. Find the value of XOR (bitwise exclusive or) on the segment.

Input

The first line contains the number n~(1 \le n \le 10^6) of array elements.

The second line contains integers a_i~(0 \le a_i \le 10^9) — the elements of the array .

The third line contains the number q~(1 \le q \le 10^6) of XOR requests on the segment.

Each of the following lines contains two integers l_i and r_i~(1 \le l_i \le r_i \le n) — the boundaries of the array segment where you must find XOR.

Output

For each query, print in a separate line the XOR of elements on the corresponding segment of array (including borders).

Examples

Example 1

Loading
Loading