Guess two numbers
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

This is an interactive problem.

Vasya and Vitya play a game. Vasya thought of two integers $$$a$$$ and $$$b$$$ from $$$1$$$ to $$$n$$$ and Vitya tries to guess them. Each round he tells Vasya two numbers $$$x$$$ and $$$y$$$ from $$$1$$$ to $$$n$$$. If both $$$x=a$$$ and $$$y=b$$$ then Vitya wins. Else Vasya must say one of the three phrases:

  1. $$$x$$$ is less than $$$a$$$;
  2. $$$y$$$ is less than $$$b$$$;
  3. $$$x$$$ is greater than $$$a$$$ or $$$y$$$ is greater than $$$b$$$.

Vasya can't lie, but if multiple phrases are true, he may choose any of them. For example, if Vasya thought of numbers $$$2$$$ and $$$4$$$, then he answers with the phrase $$$3$$$ to a query $$$(3, 4)$$$, and he can answer with the phrase $$$1$$$ or phrase $$$3$$$ to a query $$$(1, 5)$$$.

Help Vitya win in no more than $$$600$$$ rounds.

示例1

输入

复制
5
3
3
2
1
0

输出

复制
4 3
3 4
3 3
1 5
2 4

备注:

Let's analyze the sample test. The chosen numbers are $$$2$$$ and $$$4$$$. The interactor was given two instructions.

For the query $$$(4, 3)$$$, it can return $$$2$$$ or $$$3$$$. Out of the two instructions the second one is chosen, so the interactor returns $$$a^{23}_2=3$$$.

For the query $$$(3, 4)$$$, it can return only $$$3$$$.

For the query $$$(3, 3)$$$, it can return $$$2$$$ or $$$3$$$. Out of the two instructions the first one is chosen (since in case of equal values, the least number is preferred), so the interactor returns $$$a^{23}_1=2$$$.

For the query $$$(1, 5)$$$, it can return $$$1$$$ or $$$3$$$. Out of the two instructions the first one is chosen, so the interactor returns $$$a^{13}_1=1$$$.

In the fifth query $$$(2, 4)$$$, the numbers are guessed correctly, the player wins.