You and your friend are playing a card game. You have an ordered deck of cards that are numbered from to where card is placed at the top and card is placed at the bottom.
You both perform an operation on the deck until there are at least cards on the deck. You throw away the card on the top and then your friend moves the card that is now on the top of the deck to the bottom.
You are required to determine the number on the final card that is left in the deck.
Input format
Output format
For each test case, print the required answer in a new line.
Constraints
In Sample Data, Number of testcases ,
When Number of cards , so number on last card is 2.
When Number of cards , so number on last card is 2.