You are given an array A of length N. You can perform two kinds of operations on this array any number of times (possibly zero).
- Choose any non-negative integer X and then for each i, replace A[i] with (A[i] ⊕ X).
- Sort the array A.
Cost of the array is: $min_{i = 1}^{n-1} |A[i] - A[i + 1]|$. You need to minimize the cost.
Input
First line will contain a single integer T representing the test cases. For each test case there will be a single integer which will represent N. In the next line there will be N space separated integers where the i-th integer will represent A[i].
Constraints
- 1 ≤ T ≤ 50000
- 1 ≤ N ≤ 50000
- sum of N over all test cases ≤ 50000
- 0 ≤ A[i] ≤ 1018
Output
For each test case print a single line representing the minimized cost with test case number (Please check sample output for output format).
Sample
Sample Input | Sample Output |
---|---|
2 3 1 2 3 3 2 2 1 | Case 1: 1 Case 2: 0 |