Guess the Color
Given balls numbered from to . Each ball has its own color, which you do not know. There are different colors in total.
You can look at a ball in one query and find out the number of balls of the same color that you have already seen (including this one). You will not know the color of the ball itself with such a query. In total, such a query can be made no more than times.
You need to find an array of elements, where each element — an integer from to such that if and only if balls with numbers and of the same color.
Interaction
The first line contains four integers , , , and () — the number of balls, the number of colors, the maximum number of queries, and the block number, respectively. See the constraints on below.
You can make no more than queries. To make a query, you need to output the number and the number () in one line — the position of the ball you want to look at. After that, you need to output the end of line character and perform the 'flush' operation. Only after that can you read the answer.
When you already know the answer — you need to output the number and integers of the array , where each element is from to . After that, you need to output the end of line character, perform the 'flush' operation, and terminate the program.
Examples
5 3 100 0 0 0 1 1 0 2 3
1 1 1 2 1 3 1 4 1 5 1 1 1 3 2 1 2 1 2 3
Note
Let , , and .
If you look at a ball , you will get a value of . If you look at the ball again, the value will be . Now, if you look at the ball , the value will be . Then for ball — we get . For ball — we get . For ball — we get .
After that, the array can be returned. This answer will be correct.
Scoring
( points) ; ; ; there are two balls of the same color, and the rest of the balls are of different colors;
( points) ; ; ;
( points) ; ; ;
( points) ; ; ;
( points) ; ; ; for each color from to , the number of balls of this color is different; each color occurs at least once;
(up to points) ; ; :
points if you use no more than requests;
points if you use no more than requests;
points if you use no more than requests;
points if you use no more than requests;