An old machine has a single register. You load the number into it, and then the machine starts counting down: it ANDs the register with , then with , then with , and so on, one number at a time.
Sooner or later the register turns into , and once it does it can never come back. Your task is to report the number the machine was at in that moment.
Formally, find the largest for which
where denotes the bitwise AND operation. The value is allowed - the machine is happy to count all the way down.
Input
First line of input will be a single integer - the number of testcases.
Each of the next lines contains a single integer - the number loaded into the register.
Output
For every testcase print a single line with the largest such .
Example
4 2 5 17 1
1 3 15 0
For the machine first does , which is not yet, and then - so it stopped at . For the register holds the whole time and only empties it, so the answer is .
Constraints
This problem was adapted from And Then There Were K, problem A of Codeforces Round 721 (Div. 2).