CSES - K-th Highest Score
  • Time limit: 1.00 s
  • Memory limit: 512 MB

There were nn coders from Finland and nn 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 kk-th highest score in the contest.

To do this, you can ask questions: you can choose a country (Finland or Sweden) and an integer ii and you will be told the ii-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 nn and kk.

On your turn, you can print one of the following:

  • "F i\mathrm{F}\ i", where 1in1 \le i \le n: ask the ii-th highest score for Finland.
  • "S i\mathrm{S}\ i", where 1in1 \le i \le n: ask the ii-th highest score for Sweden.
  • "! s!\ s": report that the kk-th highest score is ss. 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

  • 1n1051 \le n \le 10^5
  • 1k2n1 \le k \le 2n
  • each score is between 11 and 10910^9
  • you can ask at most 100100 queries of the first two types in total

Example

3 1
F 1
9
S 1
8
! 9

Explanation: The scores for Finland are [9,4,3][9, 4, 3] and the scores for Sweden are [8,6,1][8, 6, 1]. Since k=1k = 1, the task is to find the highest score overall, which in this case is 99.