1338 - Find the lowest bit

Time Limit: 1s Memory Limit: 128MB

Submissions: 167 Solved: 52
Description
Any decimal number can write in the binary format.For example the binary format of decimal number 26 is 11010. Now please find the lowest bit of a decimal number, output it in the decimal format. The lowbit of a number is from right to left, find the first '1',then 1 with the follow 0 is the lowbit. For example A=26, the binary format is 11010 then 10 is lowbit, but we should output it with 2(decimal format) An other example is A=120, the binary format is 1111000, so it's lowbit is 1000, then we output 8.
Input
The first line has a number T, means T cases.(T <= 1000) each case input a number N in a line.(0 <= N < 1000)
Output
For each case, output a line, the lowbit of a number N.
Sample Input
2
26
120
Sample Output
2
8
Hint
Source
Zehua Hong