- Time limit: 1.00 s
- Memory limit: 512 MB
There were coders from Finland and coders from Sweden in a programming contest. It turned out that after the contest, each coder had a distinct score.
Your task is to find the -th highest score in the contest.
To do this, you can ask questions: you can choose a country (Finland or Sweden) and an integer and you will be told the -th highest score for the chosen country.
Interaction
This is an interactive problem. Your code will interact with the grader using standard input and output. You should start by reading two integers and .
On your turn, you can print one of the following:
- "", where : ask the -th highest score for Finland.
- "", where : ask the -th highest score for Sweden.
- "": report that the -th highest score is . Your program must terminate after this.
Each line should be followed by a line break. You must make sure the output gets flushed after printing each line.
Constraints
- each score is between and
- you can ask at most queries of the first two types in total
Example
3 1 F 1 9 S 1 8 ! 9
Explanation: The scores for Finland are and the scores for Sweden are . Since , the task is to find the highest score overall, which in this case is .