It was a very boring day, so a geek thought to play a game with his friends. To make the day interseting he started playing game. The game was very simple, he intitialised number to all his friends and made them stand in increasing order. eg. 1,2,3,4,5......
Now he eleminates the players at odd places and few are left. 2,4...
Again he eleminates the players at odd places and he do this util only one of his friend is left in this game. 4... And the only player left wins.
Now the task geek assigned you was that you have to find which of his friend will win.
First line contains the number of test cases t. The next t lines contain integer n, the number of players playing this game.
Display t lines, each containg a single integer, denoting the player which will win.
1 <= T <= 1000
1 <= N <= 109
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.