"N" White Walkers are positioned in a circle from "1" to "N". First (No. 1) White Walker has a dragonglass . He kills the next White Walker (i.e. No. 2) and passes the dragonglass to the next (i.e. No. 3) who kills the 4th and passes the weapon to 5th White Walker. This way alternate killing of White Walkers goes on until only 1 survives. At what position is the survivor?
Assumption: Always the first White Walker starts to kill with the dragonglass.
Input 'T' No. of test cases. 'N' Total number of White Walkers in a circle .
Output The position of the White Walker who survives.
Constraints: 1<=N<=10^5 1<=T<=100