A tournament is a directed graph in which for every unordered pair of vertices $$$(i, j)$$$ where $$$i \neq j$$$, there is either an edge from $$$i$$$ to $$$j$$$ or an edge from $$$j$$$ to $$$i$$$, but not both.
Call a vertex $$$u$$$ in a tournament good, if for every other vertex $$$v$$$, there exists a path from $$$u$$$ to $$$v$$$ with at max $$$3$$$ edges. Your task is to find a good vertex. There is a hidden tournament with $$$n$$$ vertices numbered $$$0, 1, \ldots n - 1$$$, and the only way you can extract information about it is by asking queries of the form (without quotes):
"? i j"
For each such query, the judge replies 1 if there is an edge from $$$i$$$ to $$$j$$$ in the tournament and 0 otherwise. After making some queries (limit on the number of queries specified later), you should output(without quotes):
"! v"
where $$$v$$$ is any good vertex. It can be proved that a good vertex always exists. If there exist multiple good vertices, you can output any of them.
Note that the grader is adaptive, which means that the graph is not fixed before the interaction begins. However, the judge will never contradict the replies given in the past. For example, if the judge has replied 1 for a query "? i j" in the past, then for every future query "? i j", the judge will reply 1, and for every future query "? j i", the judge will reply 0
First read an integer $$$T(1 \leq T \leq 2000)$$$, which means the number of test cases. Each test case should be considered independently. For each test case,
The sum of $$$n$$$ over all test cases doesn't exceed $$$2000$$$. Your solution is accepted if you output a good vertex for every test case, and the sum of the number of queries asked over all the testcases doesn't exceed $$${\bf 15000}$$$.
2 3 1 0 0 1 2 0
? 0 1 ? 2 1 ? 1 0 ? 0 2 ! 0 ? 0 1 ! 1
| Name |
|---|


