시간 제한메모리 제한제출정답맞힌 사람정답 비율
8 초 256 MB2000.000%

문제

This is an interactive problem.

There is an infinite grid. A token is placed in the square $(x, y)$. You are to put it in the square $(0, 0)$ following certain rules.

The possible moves are determined by a dice roll. Initially, you have one die which has the number $1$ on each of its six sides.

Each move consists of the following steps:

  1. At the beginning, you are offered a completely new six-sided die, and each side contains an integer from $1$ to $10\,000$. Each integer is chosen randomly, equiprobably from the range given above, and independently from others.
  2. After that, you have to decide whether to take the new die or throw it away. If you take the die, you have it for all the subsequent steps.
  3. The jury rolls all the dice you have. On each die, one of the six sides is selected equiprobably and independently from other dice. The sum of all numbers on the dice is denoted by $s$.
  4. You must move the token from its current square $(x_1, y_1)$ to another square $(x_2, y_2)$ which should satisfy one of the following conditions: $$ \left\lfloor \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} \right\rfloor = s \hspace{0.3cm}\mathbf{or}\hspace{0.3cm} \left\lceil \sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2} \right\rceil = s $$

프로토콜

At the beginning, the jury program prints a line with two integers $x$ and $y$ ($|x|, |y| \leq 10^9$): the initial position of the token.

Next comes a cycle of the following actions:

  1. The jury program outputs $6$ integers: the numbers on the newly proposed die.
  2. The participant's program should output the string "take" if it decided to take this die, or "pass" otherwise. The total number of dice you have should not exceed $1000$.
  3. The jury program outputs a single integer: the sum of the rolled numbers.
  4. The participant's program must print two integers: the coordinates of the square to which the move is made. The coordinates must be at most $10^9$ by absolute value.

As soon as the token is in the square $(0, 0)$, the participant's program should immediately terminate.

Your solution can make at most 60,000 queries.

예제 입력 1

10 0
7447 5427 8484 1255 5704 7121

1

2645 6158 4699 4559 3646 4307

1

4080 7552 7 9823 4362 2892 8848

8

예제 출력 1


pass

9 0

pass

8 0

take

0 0
10 0

채점 및 기타 정보

  • 예제는 채점하지 않는다.