{"problem":{"name":"Dungeon Explore","description":{"content":"This is an **interactive problem** (where your program and the judge program interact through Standard Input and Output). There is a simple connected undirected graph with $N$ vertices and $M$ edges. ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc305_f"},"statements":[{"statement_type":"Markdown","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.\n\n## Constraints\n\n*   $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.\n\n## Input And Output\n\nFirst, 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.\n\n[samples]\n\n## Notes\n\n*   **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.**","is_translate":false,"language":"English"}],"meta":{"iden":"abc305_f","tags":[],"sample_group":[],"created_at":"2026-03-03 11:01:13"}}