You are given an array containing integers. The integer is and has a utility of . You select a combination of integers whose bitwise OR is less than or equal to .
You are required to make the sum of utilities of selected integers to be as large as possible.
Input format
Output format
For each test case, print the maximum possible sum of utilities of selected integers in a new line.
Constraints
It is guaranteed that the sum of over test cases does not exceed .
For the first testcase, we select and , therefore , and the maximum sum of utilities is .
For the second testcase, we select and , therefore , and the maximum sum of utilities is .