DOIT - Do as directed

no tags 

This is my first problem. So, I'll keep it simple.

In this problem, you need to calculate XOR of the numbers formed by the index of the pairs having maximum and minimum difference.

Input

The first line contains T, the number of test cases. Each test case starts with a number N i.e. size of the given array, followed by N integers.

Output

Single line containing XOR of the numbers formed by the pairs containing maximum and minimum difference,

Example

Input:
1
2 1 3

Output:
0


Added by:sharique
Date:2016-11-09
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 MAWK BC NCSHARP COFFEE DART FORTH GOSU JULIA KTLN OCT PROLOG PYPY3 R RACKET SQLITE SWIFT UNLAMBDA