funny-operations-4

In this problem you will be doing some funny operations. These operations are basically a mixture of bitwise operations. You will be given a set of distinct numbers. You have to tell me the maximum value of P that can be obtained in any subset of that array. P is defined below :

    P = (XOR of all of the values in subset) OR (AND of all of the values in subset)

Here XOR , AND and OR are the bitwise operations.
If multiple maximum value of P are possible then consider the  subset with maximum length.

Input
First line of the input will contain T (no. of test cases). Then every test case will contain two lines. First line will have the value of N then the next line will have N space separated integers of set.
Output
For every test case, print the maximum value of P and then maximum length of the resultant subset.
Constraints
1 ≤ T ≤ 10 
1 ≤ N ≤ 16 
0 ≤ values of set ≤ 10^9

SAMPLE INPUT
1
3
1 2 3

SAMPLE OUTPUT
3 2

Explanation

One of the resultant subset is {1, 2}.

Source: hackerearth | Difficulty: EASY


Solutions: