A little boy named Aehaan is playing a game with an AI program. In this game, the program first chooses a secret number and Aehaan has to guess the number. The program follows certain rules based on Aehaan's guesses:
- If Aehaan's guess is correct, the program will print
correct
and the game will end. - If Aehaan's guess is smaller than the secret number, the program will print
low
. - If Aehaan's guess is greater than the secret number, the program will print
high
. - Aehaan has a limit of 30 guesses, and if he exceeds this limit, the program will print
too many tries
and the game will end.
Your task is to help Aehaan by writing a program that can solve the game.
Input
Input starts with an integer n (1 ≤ n ≤ 109) that denotes that the AI program has chosen an integer between 1 and n.
You need to print a series of guesses in standard output each on a single line in format: guess k
, where k is the guessed integer.
After a guess is printed, you will receive one line in standard input containing low
, high
, correct
or too many tries
as described above. If it's low
or high
, you should keep guessing. If it's correct
or too many tries
; indicates the end of the session.
Output
The validator program for this problem reads an integer n and the guessed integer p from the judge input file.
Then for each guess k
printed by the user program, it compares k
with p
and writes a single line with the appropriate status: low
, high
, correct
or too many tries
.
Sample
Sample Input | Sample Output |
---|---|
10 7 |
Sample
Sample Input | Sample Output |
---|---|
100 43 |