Gromozeka studies bit operations. Today he will learn the bitwise AND operation (
&
). Now he was wondering what is the largest integer value of
k
that will satisfy the condition written below.
x & (x - 1) & (x - 2) & ... & k = 0
Input
The first line of the input contains an integer
t
(1 <=
t
<= 3*10
4) - the number of
integers x
for which you want to find the answer. Next, the program receives
t
lines, each of which contains one integer
x
(1<=
x
<= 10< sup>9).
Imprint
For each
x
value, on a separate line print the largest integer
k
value that will satisfy the problem condition.
Examples
# |
Input |
Output |
1 |
3
2
5
17 |
1
3
15 |