Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official.
×

The problem statement has recently been changed. View the changes.

×
I. Interactive Casino

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputThis is interactive problem.

In the Interactive Casino game "Binary Roulette" is very popular. Here are the rules of the game.

- Initially the player has 160 tokens.
- In one turn player can bet any positive integer amount of tokens, as long as it does not exceed number of tokens player currently has.
- Inside of slot machine an integer
*x*between 0 and 2^{20}- 1 is generated. If sum of bits of this integer is odd, then player wins (i.e. returns his bet and additional*k*tokens), otherwise the player loses his bet. Note that player does not know value of*x*. - If the player has zero tokens, game is lost.
- If the player makes more than 200 bets, game is lost.
- If the player at some time has 200 tokens, he won the game.

You found on the Algoleaks site that each next integer on the sloth machine is generated using the formula . Source of *x*_{1}, unluckly, on this site is not revealed.

Your goal is to ensure the victory.

Input

Your program will receive on the input one integer — number of tokens You currently have or - 1 in case when game is over by some reason.

Output

If you received - 1, immediately exit your program with code 0 (otherwise you may get the random verdict from the system). Otherwise, if you received integer *T* > 0, print one integer between 1 and *T*, inclusively — your next bet. Dont forget to print end-of-line character and flush the output.

Example

Input

160

155

165

180

-1

Output

5

10

15

20

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/01/2023 13:43:20 (l1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|