You are given an integer array a of size n. You need to select an integer K(0≤K<231) and perform the following operation exactly once.
XOR all the elements of a with K. That is, assign ai=ai⊕K for all 1≤i≤n, where ⊕ is the bitwise xor operator.
Your goal is to make the array non-decreasing.
Output the minimum K and number of possible K(0≤K<231) that makes the array non-decreasing.
If it is impossible to find such K, output −1.
Input
The first line of the input contains a single integer t(1≤t≤10000) — the number of test cases.
The first line of each test case contains an integer n(1≤n≤2×105) — the number of elements in the array.
The second line of each test case contains n space-separated integers a1,a2,…,an(0≤ai<231) — the elements of the array.
It is guaranteed that the sum of n over all test cases does not exceed 5×105.
Output
For each test case, if it is impossible to find such K, then output −1. Otherwise, print two integers — minimum K and the number of possible K(0≤K<231).