Consider an array A of length N. The instability of A is defined as ∑_i=1N−1(∣A\[i+1]−A\[i]∣).
Master Zhu wants to stabilize an array. In order to do that, he wants to select an integer X and change every element A\[i] to (A\[i]⊕X). Here, u⊕v is the bitwise XOR of u and v.
Find the smallest non-negative integer X Master Zhu must choose to minimize the instability of a given array, and calculate the resulting instability.
The first line of input contains an integer N (1≤N≤105). Next line contains N integers A\[i], indicating the elements of the array (0≤A\[i]<220).
Print a single line containing two integers: the smallest non-negative integer X which must be used in order to reach the minimum possible instability and the resulting instability itself.