≤ or ≥

아직 제출이 없습니다시간 제한3초메모리 제한512 MB

문제

There are nn stacks, each containing kk positive integers not exceeding 10910^9. You play a game with the jury program. Initially you know only the topmost value of each stack. Game proceeds as follows:

  • At the beginning of each turn you choose some integer xx
  • After that, jury program selects one of the options: "\leq" or "\geq". Denote the chosen relation as RR
  • For every non-empty stack, if the topmost element tt satisfies the inequality "tR˜x˜t\~R\~x", tt is being removed from the stack. This procedure is performed only once with each stack.
  • Finally, you are told what was the chosen relation RR and current state of each stack, that is either information that the stack is empty or the stack topmost number.

In all tests except sample n=10,000n = 10\\,000, k=10k = 10. Your task is to clear all stacks in no more than 5050 moves.

Note that the jury program is adaptive, i.e. stack contents are not fixed and may change "on the run" depending on the output of your program.

힌트

In the sample test there are four fixed stacks of size 2:

1  2  3  4
5  6  7  8

Next we describe the interaction example as shown in "Example" section. Note that, although the stacks are fixed, the interactor in the system may behave not exactly in this way even if you ask the same queries.

In the first query x=2x = 2 and R=R = "\leq". After the query numbers 11 and 22 are removed and stacks look like this:

      3  4
5  6  7  8

In the second query x=4x = 4 and R=R = "\geq". Numbers 55, 66 and 44 are removed, and the stacks' state is:

      3 
      7  8