This is an interactive problem.
I have a hidden permutation $$$p_1$$$, $$$p_2$$$, ..., $$$p_n$$$. You are not to guess it. Your task is to devise a data structure (that's against the rules!) that supports the following operations on a set $$$S$$$, which is initially empty:
You will have to perform "getMin" after each operation of other types.
You don't know the permutation, but you can make queries. In one query you can choose $$$k$$$ distinct indices $$$x_1$$$, $$$x_2$$$, ..., $$$x_k$$$ for some value of $$$k$$$, and in return I will tell you the permutation of these indices $$$y_1$$$, $$$y_2$$$, ..., $$$y_k$$$ such that $$$p_{y_1} \lt p_{y_2} \lt \ldots \lt p_{y_k}$$$. In other words, I will sort the indices according to $$$p$$$.
Note that all $$$x_i$$$ should be present in $$$S$$$ at the moment of query.
It is easy to perform "getMin" in $$$1$$$ query — just sort everything in $$$S$$$. It is also not hard to perform it using several queries with sum of $$$k$$$ up to $$$O(\log n)$$$. Can you flex your algorithm (this is lame) muscles and satisfy both?
Note that since you don't know $$$p$$$ and my task is to make your solution fail, I can change $$$p$$$ depending on your queries, but only in such a way that all my previous responses are correct. I can also choose the order of operations you have to perform depending on your queries.
Initially you are given a single line with one integer $$$n$$$ ($$$1 \le n \le 8000$$$) — the number of elements. Each element will be inserted and deleted exactly once.
Then there will be exactly $$$2n$$$ rounds of interaction.
Each round of interaction consists of $$$4$$$ phases:
It is guaranteed that all $$$2n$$$ possible operations ("add $$$x$$$" and "delete $$$x$$$" for all $$$1 \le x \le n$$$) will occur exactly once, and for each $$$x$$$ operation "add $$$x$$$" will precede "delete $$$x$$$".
Do not forget to print end of line and flush your output before you read anything.
3 add 1 1 add 3 3 1 delete 1 3 add 2 3 2 delete 3 2 delete 2
1 1 1 2 1 3 3 1 3 3 2 2 3 3 1 2 2 0 -1
In the example $$$p = [2, 3, 1]$$$.
| Name |
|---|


