SP27320 VECTAR10 - Card Game

Description

Changu and Mangu have an ordered deck of **n** cards numbered 1 to **n** with card 1 at the top and card **n** at the bottom. They want to play a game. They perform a wierd operation as long as there are at least two cards in the deck: Changu throws away the top card and then Mangu moves the card that is now on the top of the deck to the bottom of the deck. Your task is to find the last remaining card.

Input Format

Each line of input (except the last) contains a positive number **n**

Output Format

For each number from input produce one line of output giving the last remaining card.