{"raw_statement":[{"iden":"problem statement","content":"This is an **interactive problem** (where your program and the judge program interact through Standard Input and Output).\nThere is a simple connected undirected graph with $N$ vertices and $M$ edges. The vertices are numbered with integers from $1$ to $N$.\nInitially, you are at vertex $1$. Repeat moving to an adjacent vertex at most $2N$ times to reach vertex $N$.\nHere, you do not initially know all edges of the graph, but you will be informed of the vertices adjacent to the vertex you are at."},{"iden":"constraints","content":"*   $2\\leq N\\leq100$\n*   $N-1\\leq M\\leq\\dfrac{N(N-1)}2$\n*   The graph is simple and connected.\n*   All input values are integers."},{"iden":"input and output","content":"First, receive the number of vertices $N$ and the number of edges $M$ in the graph from Standard Input:\n\n$N$ $M$\n\nNext, you get to repeat the operation described in the problem statement at most $2N$ times against the judge.\nAt the beginning of each operation, the vertices adjacent to the vertex you are currently at are given from Standard Input in the following format:\n\n$k$ $v _ 1$ $v _ 2$ $\\ldots$ $v _ k$\n\nHere, $v _ i\\ (1\\leq i\\leq k)$ are integers between $1$ and $N$ such that $v _ 1\\lt v _ 2\\lt\\cdots\\lt v _ k$.\nChoose one of $v _ i\\ (1\\leq i\\leq k)$ and print it to Standard Output in the following format:\n\n$v _ i$\n\nAfter this operation, you will be at vertex $v _ i$.\nIf you perform more than $2N$ operations or print invalid output, the judge will send `-1` to Standard Input.\nIf the destination of a move is vertex $N$, the judge will send `OK` to Standard Input and terminate.\nWhen receiving `-1` or `OK`, immediately terminate the program."},{"iden":"notes","content":"*   **In each output, insert a newline at the end and flush Standard Output. Otherwise, the verdict may be TLE.**\n*   **The verdict will be indeterminate if the program prints invalid output or quits prematurely in the middle of the interaction.**\n*   Terminate the program immediately after reaching vertex $N$. Otherwise, the verdict will be indeterminate.\n*   **The judge for this problem is adaptive. This means that the graph may change without contradicting the constraints or previous outputs.**"},{"iden":"sample interaction","content":"In the following sample interaction, we have $N=4$, $M=5$, and the graph in the figure below.\n![image](https://img.atcoder.jp/abc305/ae6ce1b3c8e950777761893a567c4d11.png)\n\nInput\n\nOutput\n\nDescription\n\n`4 5`\n\n$N$ and $M$ are given.\n\n`2 2 3`\n\nYou start at vertex $1$. The vertices adjacent to vertex $1$ are given.\n\n`3`\n\nYou choose to go to vertex $v _ 2=3$.\n\n`3 1 2 4`\n\nThe vertices adjacent to vertex $3$ are given.\n\n`2`\n\nYou choose to go to vertex $v _ 2=2$.\n\n`3 1 3 4`\n\nThe vertices adjacent to vertex $2$ are given.\n\n`4`\n\nYou choose to go to vertex $v _ 3=4$.\n\n`OK`\n\nSince you have reached vertex $4$ within $8(=2\\times4)$ moves, `OK` is passed.\n\nYou will be judged as correct if you immediately terminate the program after receiving `OK`."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}