Finding 67#12267

Finding 67

4 seconds
256 megabytes
Very hard

This is an interactive problem.

We say that a number is tuff if it's of the form x_1x_2...x_{i-2}x_{i-1}67x_{i+2}x_{i+3}...x_{n-1}x_{n}, in other words, if it contains the digits and consecutively, (for an example, the numbers 67 , 2136709 , 677767 are tuff while the numbers 76 , 617 , 100 are not tuff).

There is a hidden non-tuff number of length , You want to find the minimum positive integer such that the number x+y is tuff.

You can ask the following query no more than times:

And the interactor will return the set of unique digits appearing at the queried positions in arbitrary order, i.e. x_{a_1} , x_{a_2} , , x_{a_{sz}}, (for an example, asking for the positions and in the number will return the set of size ).

Note : x_1 is the most significant digit in the number (the leftmost digit) and x_n is the least significant digit (the rightmost digit).

Input

Each test contains multiple test cases. The first line contains the number of test cases (1 \le t \le 10^5). The description of the test cases follows.

The only line of each test case contains a single integer (1 \le n \le 10^5) the length of the number .

It is guaranteed that the sum of over all test cases does not exceed 10^5.

Interaction

The interaction for each test case begins with reading the integer .

Then you can ask up to queries.

To make a query, output a line in the following format:

  • a_1 a_2 a_{sz} ( , a_i ), the array must be distinct.

The jury will return the answer to the query in the following format :

  • s_1 s_2 s_m

Where is the size of the set and s_i are the elements of the set, (1 \le m \le 10 , 0 \le s_i \le 9).

When you find the number , output a single line in the following format:

This is not considered a query so it doesn't count towards the queries.

After that, proceed to process the next test case or terminate the program if it is the last test case.

The interactor is not adaptive, which means that the number is determined before the participant asks any queries.

After printing each query, do not forget to output the end of line and flush the output. Otherwise, you will get Idleness limit exceeded verdict.

If, at any interaction step, you read instead of valid data, your solution must exit immediately. This means that your solution will receive Wrong answer because of an invalid query or any other mistake. Failing to exit can result in an arbitrary verdict because your solution will continue to read from a closed stream.

Examples

Example 1

Loading
Loading

Note

In the Example, the interaction proceeds as follows.

\begin{array}{|c|c|l|} \hline \textbf{Solution} & \textbf{Jury} & \textbf{Explanation} \\ \hline & \texttt{2} & \small \text{There are 2 test cases.} \\ \hline & \texttt{2} & \small \text{The hidden number is }35\text{ (of length 2).} \\ \hline \texttt{? 2 1 2} & \texttt{2 3 5} & \small \text{Solution queries positions 1 and 2. } \\ \hline \texttt{? 1 1} & \texttt{1 3} & \small\text{Solution queries position 1. Since }x_1=3,\text{ the jury returns } 1\space3. \\ \hline \texttt{! 32} & & \small \text{Solution determines that the answer is }32. \\ \hline & \texttt{3} & \small \text{The hidden number is }668\text{ (of length 3).} \\ \hline \texttt{? 3 3 1 2} & \texttt{2 6 8} & \small\text{Solution queries positions 3, 1, and 2.} \\ \hline \texttt{? 1 3} & \texttt{1 8} & \small \text{Solution queries position 3.} \\ \hline \texttt{! 2} & & \small\text{Solution determines that the answer is }2. \\ \hline \end{array}

Note that the empty lines in the example input and output are only for readability. They do not appear in the actual interaction.

Scoring

  1. Subtask ( points) : (n \le 30)

  2. Subtask ( points) : the number doesn't contain the digit .

  3. Subtask ( points) : no additional constraints.