Gilfoyle and Dinesh are again arguing about who is the more efficient programmer. Richard is fed up of them so he asks Jian Yang to come up with a question to help the former two get back to work. In turn Jian Yang comes up with a simple question. He wants them to find the minimum value of c for which the value of the expression below is maximum?
((((a xor b) or c) xor d) or e)
Since Gilfoyle and Dinesh want to continue arguing, so they want you to solve this problem. Can you come up with a solution?
INPUT FORMAT:
The first line contains an integer T, denoting the number of test cases. Each of the next T lines contains four space separated integers a,b,d and e.
OUTPUT FORMAT:
For each test case print a single integer c in a new line. c must be less than 260.
CONSTRAINTS:
1≤ T ≤105
1≤ a,b,c,d,e <260