405018: GYM101741 H Compressed Spanning Subtrees

Memory Limit:0 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Compressed Spanning Subtreestime limit per test2 secondsmemory limit per test256 mebibytesinputstandard inputoutputstandard output

This is an interactive problem. Make sure that your output does not get buffered after each query. Use, for instance, fflush(stdout) in C++, System.out.flush() in Java, or sys.stdout.flush() in Python.

For a tree T consisting of n vertices numbered from 1 to n, the compressed spanning subtree S(X) of a set X of spanned vertices (vertices that are not in X are called not spanned) can be defined by the following algorithm:

  1. Assign S(X) ≤ ftarrow T;
  2. If there is any not spanned vertex that has exactly one edge incident to it, remove it along with the edge;
  3. Repeat step 2 while its condition stays true;
  4. If there is any not spanned vertex that has exactly two edges incident to it, remove it along with the edges and add a new edge connecting the two remaining endpoints of the removed edges;
  5. Repeat step 4 while its condition stays true.

Formally, S(X) is the smallest subgraph of T containing all vertices in X and then having all other vertices of degree two or less smoothed out.

The tree from test 1, and its compressed spanning subtrees for X = {3, 4, 6} and for X = {2, 5, 6}.

You are not given the tree T. Instead, your task is to find it. You can ask questions of the following form: "How many vertices does the compressed spanning subtree of X contain?". And since otherwise finding the tree by asking such questions would be impossible, there are no vertices incident to exactly two edges in T.

Interaction

The first line of input contains a single integer n (2 ≤ n ≤ 100).

Your program can ask a question by printing a line in the format "k x1 x2 ... xk" where integer k (1 ≤ k ≤ n) equals to the number of vertices in X and distinct integers xi (1 ≤ xi ≤ n) represent these vertices in any order. You can ask no more than 2550 questions.

The answer for such question is an integer given on a separate line: the number of vertices in the compressed spanning subtree in question.

After asking sufficient questions, your program must give the answer by printing a line in the format "p2 p3 ... pn". Here, considering T as a rooted tree with root at vertex 1, pi must be the parent vertex of vertex i. After giving the answer, the program must immediately terminate gracefully.

ExampleInput
6 



3



4



4
Output


? 3 4 3 6




? 4 1 2 3 6



? 3 2 5 6



! 1 2 2 3 3

加入题单

算法标签: