**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
#define int long long
const int N = 2e5 + 7;
int fa[N] = {0};
int deep[N] = {0};

bool query(int a, int b) {
    if (a == b)return false;
    cout << "? " << a << " " << b << endl;
    int res = 0;
    cin >> res;
    return res;
}

void solve() {
    int n;
    cin >> n;
    int t = 0;
    for (int i = 2; i < n - 1; i++) {
        if (!query(1, i)) {
            fa[i] = 1;
            t = i - 1;
            break;
        }
    }
    if (t == 0) {
        fa[n - 1] = 1;
        cout << "! ";
        for (int i = 1; i < n; i++) {
            cout << fa[i] << " ";
            fa[i] = 0;
        }
        cout << endl;
        return;
    }
    int last = 1;
    deep[1] = t + 1;
    for (int i = 2; i <= t; i++) {
        deep[i] = i;
    }
    for (int i = t + 2; i < n; i++) {
        for (int j = last; j <= t; j++) {
            if (!query(i, j)) {
                fa[i] = deep[j];
                deep[j] = i;
                last = j;
                break;
            }
        }
    }
    cout << "! ";
    for (int i = 1; i < n; i++) {
        cout << fa[i] << " ";
        deep[i] = fa[i] = 0;
    }
    cout << endl;
}

signed main() {
 //   freopen("D:\\Development_Software\\CLion\\CLionProjects\\Work\\in", "r", stdin);
    ios::sync_with_stdio(false);
    int T = 1;
    cin >> T;
    while (T--)solve();
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a test input that exposes the bug in the provided code, we need to focus on edge cases or scenarios that maximize the failure probability. The code has a few potential issues:

1. **Handling of the first query**: The code assumes that it will always find a node `i` such that `query(1, i)` returns `false`. If this assumption fails, the code will not correctly set the parent for some nodes.
2. **Edge cases for small trees**: The code might not handle small trees (e.g., `n = 4`) correctly.
3. **Handling of the last node**: The code might not correctly handle the last node in the tree.

Let's construct a small-scale test input that can expose these issues:

### Test Input
```plaintext
3
4
5
6
```

### Explanation

1. **Test Case 1 (n = 4)**:
   - The tree could be:
     ```
     0
     |
     1
    / \
   2   3
     ```
   - The code should correctly determine the parent of nodes 2 and 3.

2. **Test Case 2 (n = 5)**:
   - The tree could be:
     ```
     0
     |
     1
     |
     2
    / \
   3   4
     ```
   - The code should correctly determine the parent of nodes 3 and 4.

3. **Test Case 3 (n = 6)**:
   - The tree could be:
     ```
     0
     |
     1
     |
     2
     |
     3
    / \
   4   5
     ```
   - The code should correctly determine the parent of nodes 4 and 5.

### Expected Behavior
- For `n = 4`:
  - The queries should be:
    - `? 2 3` (which should return `1` because the path between 2 and 3 contains 0)
  - The output should be:
    - `! 0 0 1 1`

- For `n = 5`:
  - The queries should be:
    - `? 2 3` (which should return `1` because the path between 2 and 3 contains 0)
    - `? 2 4` (which should return `1` because the path between 2 and 4 contains 0)
  - The output should be:
    - `! 0 0 1 2 2`

- For `n = 6`:
  - The queries should be:
    - `? 2 3` (which should return `1` because the path between 2 and 3 contains 0)
    - `? 2 4` (which should return `1` because the path between 2 and 4 contains 0)
    - `? 2 5` (which should return `1` because the path between 2 and 5 contains 0)
  - The output should be:
    - `! 0 0 1 2 3 3`

This test input is small and complete, and it should help expose any issues in the code's handling of small trees and the last node.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
#include<iostream>
#include<vector>
#include<set>
using namespace std;

int main() {
    int tc;
    cin>>tc;

    while(tc--) {
       int n;
       cin>>n;
       set<int>s;
       vector<int>solution(n-1, -1);

        for (int i = 1; i <= n-1; i++)
            s.insert(i);

        while(!s.empty()) {

            // get larget item
            int largest = *(--s.end());
            s.erase(largest);
            vector<int>branch;

            int threshold = INT_MAX;

            for (int i = largest; i <=n-2; i++)
            {
                if (i >= n-1) break;
                threshold = min(threshold, solution[i]);

            }
            if (solution[largest-1] >= 0) continue;
            for (auto item : s) {
                if (item > threshold) break;
                cout<<"? "<<item<<" "<<largest<<endl;
                int r;
                cin>>r;
                if (r == 1) continue;
                else if (r == -1) return 0;
                else {
                    branch.push_back(item);
                }
            }
            branch.push_back(largest);

            solution[branch[0]-1] = 0;
            for (int i = 1; i < branch.size(); i++) {
                solution[branch[i]-1] = branch[i-1];
                s.erase(branch[i]);
            }

            s.erase(branch[0]);

            for (auto it = s.begin(); it != s.end(); ) {
                if (*it < branch[0]) {
                    solution[*it] = 0;
                    it++;
                }
                else {
                    break;
                }
            }
        }

        cout<<"! ";
        for (int i = 0; i < solution.size(); i++)
            cout<<solution[i]<<" ";
        cout<<endl;

    }
    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
1
5
```

This test input is designed to expose potential issues in the buggy code:

1. **Tree Structure**: The input represents a tree with 5 nodes, which is a small-scale test case.
2. **Edge Cases**: The tree structure ensures that the conditions of the problem are met:
   - Node 0 is the root.
   - Node 1 has exactly two adjacent nodes (0 and another node).
   - Removing node 0 results in a forest of paths.
3. **Query Limit**: The input will test the algorithm's ability to correctly determine the parent nodes with a limited number of queries (up to 4 queries for this case).

This test case should help identify any issues in the logic of the buggy code, particularly in how it handles the queries and updates the solution vector.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
from sys import stdout
for i in range(int(input())):
    n = int(input())
    parents = 1
    p = dict()
    p[1] = 0
    val = 0
    for i in range(2, n):
        print('?', 1, i)
        stdout.flush()
        inp = int(input())
        if inp == 1:
            parents += 1
            p[i] = 0
        else:
            p[i] = 1
            val = i
            break
        val = i
    last = dict()
    for k in range(1, parents+1):
        last[k] = k
    last[1] = val
    c = 2
    not_parent = set()
    for i in range(val + 1, n):
        while True:
            if c in not_parent:
                c = (c %parents) + 1
                continue
            j = c
            print('?', j, i)
            stdout.flush()
            inp = int(input())
            if inp == 0:
                p[i] = last[j]
                last[j] = i
                c = (c %parents) + 1
                break
            else:
                not_parent.add(j)
            c = (c%parents) + 1
    print('!', end = ' ')
    for i in range(1, n):
        print(p[i], end = ' ')
    print()
    stdout.flush()

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided code, we need to consider the constraints and the specific conditions mentioned in the problem description. The code has a few potential issues:

1. It assumes that the node `1` has exactly two adjacent nodes, including the root node `0`.
2. It may not handle cases where the structure of the tree is more complex, especially when the paths from the root are not straightforward.

Let's construct a test case that maximizes the failure probability:

1. **Node `1` has exactly two adjacent nodes**: This is a given condition and should be satisfied.
2. **Multiple paths from the root**: We need to ensure that the tree has multiple paths from the root, and the paths are not trivially linear.
3. **Query limits**: The code should not exceed the query limit of \(2n - 6\).

Here is a small-scale test input that fits these criteria:

```plaintext
1
6
```

This test case represents a tree with 6 nodes. Let's construct the tree such that it has multiple paths from the root and node `1` has exactly two adjacent nodes:

- Node `0` (root) is connected to nodes `1` and `2`.
- Node `1` is connected to node `3`.
- Node `2` is connected to nodes `4` and `5`.

This tree structure satisfies all the conditions:
- Node `1` has exactly two adjacent nodes: `0` and `3`.
- Removing node `0` results in a forest of paths: `1-3`, `2-4`, and `2-5`.
- The nodes are indexed such that if \(1 \le x \le y \le n-1\), then \(p_x \le p_y\).

This test case should be challenging for the provided code because it requires the algorithm to correctly identify the parent nodes for nodes `3`, `4`, and `5` while respecting the query limit.

Here is the test input:

```plaintext
1
6
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
from collections import *
from queue import *
from heapq import *
from sys import *
def bs(arr, x):
    low=0
    high=len(arr)-1
    while low < high:
        mid = (low+high-1)//2+1
        if arr[mid] <= x:
            low = mid
        else:
            high = mid - 1
    return low
for _ in range(int(input())):
    z=int(input())
    q=[-1]*(z-1)
    q[0]=0
    l=[1]
    for i in range(1,z-1):
        print('?',1,i+1)
        e=int(input())
        stdout.flush()
        if not (e):
            q[i]=1
            l.append(i+1)
    l.append(z)
    r=0
    w=list(range(l[0]+1,l[1]))
    for i in range(1,len(l)-1):
        k=list(range(l[i]+1,l[i+1]))
        g=[]
        r=0
        for l in k:
            while True:
                print('?',w[r],l)
                rt=int(input())
                if not (rt):
                    g.append(l)
                    q[l-1]=w[r]
                    break
                r+=1
                stdout.flush()
                if r==len(w):
                    break
            if r==len(w):
                w=g
                r=0
                g=[]
        w=g
    l=''
    k=[0]*z
    r=0
    for i in q:
        if i<=0:
            l+='0 '
        else:
            if k[i]==0:
                l+=str(i)+' '
            else:
                l+=str(k[i])+' '
            k[i]=r+1
        r+=1
    print('!',l)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
4
1
5
1
0
9
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
from sys import stdin, stdout
from collections import deque, Counter, defaultdict
from bisect import bisect_left, bisect_right
from math import *
from heapq import *

def input():
    return stdin.readline().strip()

def print(*obj, sep = ' ', end = '\n'):
    objs = [str(i) for i in obj]
    return stdout.write(sep.join(objs) + end)

def int_space():
    return list(map(int,input().split()))

def int_string():
    return [int(i) for i in input()]

alph = "abcdefghijklmnopqrstuvwxyz"
mod = int(1e9 + 7)

def solve():
    n = int(input())
    parent = [0 for _ in range(n)]
    parent[1] = 0
    last_level = [1]
    for i in range(2, n):
        print(f"? {i} {1}")
        stdout.flush()

        response = int(input())

        if response == 1:
            last_level.append(i)
            parent[i] = 0

        else:
            parent[i] = 1
            break

    branches = len(last_level)
    last_inactive = 0

    i = branches + 2
    j = 0

    while i < n:
        if j == branches:
            j = last_inactive + 1

        print(f"? {last_level[j]} {i}")
        stdout.flush()

        response = int(input())

        if response == 0:
            parent[i] = last_level[j]
            last_level[j] = i

        elif response == -1:
            break
        else:
            last_inactive = j
            j += 1
            continue

        j += 1
        i += 1

    print("!", *parent[1:])
    stdout.flush()

t = int(input())
#t = 1
for _ in range(t):
    solve()

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
4
1
5
1
0
9
1
1
1
1
1
1
1
1
1
```


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
import java.util.*;
public class Genokraken {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int testCases=sc.nextInt();
		for (int z=0;z<testCases;z++) {
			int totalNodes=sc.nextInt()-1;
			int[] parents = new int[totalNodes];
			parents[0]=0;
			int firstAfterCycle=1;
			int cycleCount=0;
			int count=1;
			while (cycleCount==0) {
				System.out.println("? "+(count+1) +" "+1);
				System.out.flush();
				if (sc.nextInt()==0) {
					cycleCount=count;
					parents[count]=1;
					break;
				}
				parents[count]=0;
				count++;
			}
			int[] latest = new int[cycleCount+1];
			for (int i =1;i<cycleCount+1;i++) {
				latest[i]=i;
			}
		//	System.out.println(cycleCount);
			int lastParent=1;
			int currParent=1;
			int flag=0;
			for (int i =(count+1);i<totalNodes;i++) {
				if (firstAfterCycle==cycleCount) {
					parents[i]=latest[cycleCount];
					latest[cycleCount]=(i+1);
					continue;
				}
				System.out.println("? " + (i+1) + " " + currParent);
				//System.out.println("here");
				int result=sc.nextInt();
				if (result==1) {
				//	System.out.println("here1");
					//diff parent
					currParent++;
					if (currParent>cycleCount) {
						currParent=firstAfterCycle;
						flag=1;
					}
					i--;
					continue;
				}
				if (result ==0) {
				//	System.out.println("here0");
					//this parent is the one
					lastParent=currParent;
					if (flag==1) {
						firstAfterCycle=currParent;
						flag=0;
					}
					parents[i]=latest[currParent];
					latest[currParent]=(i+1);
					currParent++;
					if (currParent>cycleCount) {
						currParent=firstAfterCycle;
						flag=1;
					}
				}
			}
			System.out.print("!");
			for (int i =0;i<totalNodes;i++) {
				System.out.print(" "+parents[i]);
			}
			System.out.println();
			System.out.flush();
		}
	}

}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to focus on edge cases that can highlight issues in the logic. The key points to consider are:

1. **Node 1 having exactly two adjacent nodes (including the root node 0)**.
2. **The condition that if we remove node 0, the remaining nodes form a forest of paths**.
3. **The constraints on the number of queries**.

Given these constraints, a small-scale test input that can expose the bug is a tree with 5 nodes. This size is manageable and can still highlight issues in the code.

Here's a step-by-step approach to generate the test input:

1. **Tree Structure**:
   - Node 0 (root) is connected to nodes 1 and 2.
   - Node 1 is connected to node 3.
   - Node 2 is connected to node 4.

2. **Queries**:
   - The code should be able to correctly identify the parent nodes for nodes 1, 2, 3, and 4.

3. **Expected Output**:
   - The correct parent array for the tree should be `[0, 0, 1, 2]`.

Let's construct the test input:

```plaintext
1
5
```

This input represents a single test case with 5 nodes. The tree structure is as follows:
- Node 0 is the root.
- Node 1 is connected to node 0 and node 3.
- Node 2 is connected to node 0 and node 4.

The expected output for this test case should be:
- The queries to determine the parent nodes.
- The final output of the parent array.

By running the provided code with this input, we can observe if the code correctly identifies the parent nodes and adheres to the query limit. This small-scale test input should help expose any issues in the logic of the buggy code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
import java.util.LinkedList;
import java.util.*;

public class D_Genokraken {

    public static void main(String[] args) {
        Scanner in = new Scanner (System.in);
        int T = in.nextInt();
        while(T-->0){
            int n = in.nextInt();
            int i = 2;
            Queue<Integer> q = new LinkedList<>();
            while (i<n){
                System.out.println("? "+1+" "+i);
                int val = in.nextInt();
                if (val==0)break;
                i++;
            }
            int[] p =new int[n];
            for (int j = 1;j<i;j++)p[j]=0;
            p[i]=1;
            for (int j = 2;j<i;j++){
                q.add(j);
            }
            i++;
            while (i<=n-1) {
                int val;
                if (q.size()>1){
                    System.out.println("? "+q.peek()+" "+i);
                    val = in.nextInt();
                }
                else val = 0;
                if (val==0){
                    p[i]=q.remove();
                    q.add(i);
                    i++;

                }
                else{

                    q.remove();
                }
            }
            System.out.print("! ");
            for ( i = 1;i<n;i++){
                System.out.print(p[i]+" ");
            }
            System.out.println();
        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to focus on edge cases that can maximize the failure probability. Let's analyze the code and identify potential issues:

1. **Initial Query Loop**:
   - The code starts by querying "? 1 i" for i from 2 to n-1 until it gets a response of 0. This loop is designed to find the first node i such that the path between node 1 and node i does not contain node 0.
   - If the tree is structured in a way that all nodes 2 to n-1 are directly connected to node 0, this loop will not break early, and it will incorrectly set `p[i] = 1` for all i.

2. **Queue Handling**:
   - The code uses a queue to manage the nodes. It adds nodes to the queue and then queries the path between the first node in the queue and the next node i.
   - If the path does not contain node 0, it sets `p[i] = q.remove()` and adds i to the queue. If the path contains node 0, it simply removes the first node from the queue.
   - This logic can fail if the tree is not structured in a way that ensures the queue is always correctly managed.

3. **Output**:
   - The code outputs the parent array `p` at the end.

To expose the bug, we need a tree structure that causes the initial loop to run through all nodes 2 to n-1 without breaking early, and then causes the queue management to fail.

### Challenging Test Input

Let's create a test case where all nodes 2 to n-1 are directly connected to node 0, and node 1 is connected to node 0 and one other node (node 2 for simplicity).

```plaintext
1
5
0
0
0
0
```

### Explanation:
- **n = 5**: We have 5 nodes.
- **0 0 0 0**: The responses to the queries "? 1 2", "? 1 3", "? 1 4", and "? 1 5" are all 0, indicating that the path between node 1 and nodes 2, 3, 4, and 5 does not contain node 0.

### Tree Structure:
- Node 0 is the root.
- Node 1 is connected to node 0 and node 2.
- Nodes 2, 3, 4, and 5 are directly connected to node 0.

### Expected Output:
- The correct parent array should be: `! 0 0 0 0 0`.

### Actual Output (Buggy Code):
- The buggy code will incorrectly set `p[2] = 1` and then fail to correctly manage the queue, leading to incorrect parent assignments.

This test case should expose the bug in the initial loop and queue management.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3,"Ofast","inline")

int main(){
    int numsofcases;
    cin >> numsofcases;
    for(int numso=0;numso<numsofcases;numso++){
        int n,m,a,b,i=2,flag=0,j=0,T=2;
        vector<int> an,ty,t;
        cin>>n;
        an.push_back(0);
        ty.push_back(1);
        while(1){
            if(i>=n) break;
            if(flag==0){
            cout<<"? "<<1<<" "<<i<<endl;
            cout.flush();
            cin>>m;
            if(m==-1) break;
            else if(m){
                ty.push_back(i);
                an.push_back(0);
                i++;
            }
            else{
                flag=1;
                ty[0]=i;
                an.push_back(1);
                i++;
            }
            }
            else{
            if(flag==1){
                for(int o=0;o<ty.size();o++){
                    t.push_back(1);
                }
                t[0]+=1;
                flag=2;
            }
            if(ty.size()==1){
                an.push_back(ty[0]);
                for(;i<n-1;i++){
                    an.push_back(i);
                }
                break;
            }
            if(j==ty.size()){
                j=0;
                continue;
            }
                cout<<"? "<<ty[j]<<" "<<i<<endl;
                cout.flush();
                cin>>m;
                if(m==-1) break;
                else if(m){
                    if(t[j]<T){
                        ty.erase(ty.begin()+j);
                        t.erase(t.begin()+j);
                    }
                    else{
                        j++;
                    }
                }
                else{
                    an.push_back(ty[j]);
                    ty[j]=i;
                    t[j]+=1;
                    if(j&&t[j]>T){
                        T=t[j];
                        ty.erase(ty.begin(),ty.begin()+j);
                        t.erase(t.begin(),t.begin()+j);

                        j=0;
                    }
                    i++;
                }
            }
        }cout<<"! ";
        for(int o=0;o<n-1;o++){
            cout<<an[o]<<" ";
        }
        cout<<endl;

    }
    return 0;
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided code, we need to focus on edge cases and scenarios that might cause the algorithm to fail. The code seems to have issues with handling the structure of the tree and the queries efficiently. Let's consider the following points:

1. **Node 1 having exactly two adjacent nodes**: This is a critical condition that the code should handle correctly.
2. **Paths formed after removing node 0**: The code should ensure that the paths formed are valid.
3. **Query limit**: The code should not exceed the query limit of \(2n - 6\).

Given these points, let's create a small-scale test input that maximizes the failure probability:

### Test Case 1: Simple Tree with 4 Nodes
This test case will check if the code can handle the simplest valid tree structure.

### Test Case 2: Tree with 5 Nodes
This test case will check if the code can handle a slightly more complex tree structure.

### Test Case 3: Tree with 9 Nodes
This test case will check if the code can handle a more complex tree structure with multiple paths and nodes.

### Test Input
```plaintext
3
4
5
9
```

### Explanation
1. **Test Case 1 (4 Nodes)**:
   - Tree: 0 - 1 - 2, 0 - 3
   - This is the simplest valid tree where node 1 has exactly two adjacent nodes (0 and 2).

2. **Test Case 2 (5 Nodes)**:
   - Tree: 0 - 1 - 2, 0 - 3, 0 - 4
   - This tree has node 1 with exactly two adjacent nodes (0 and 2), and two additional paths from node 0.

3. **Test Case 3 (9 Nodes)**:
   - Tree: 0 - 1 - 2, 0 - 3 - 4 - 5 - 6, 0 - 7 - 8
   - This tree has node 1 with exactly two adjacent nodes (0 and 2), and two additional paths from node 0, one of which is a longer path (3 - 4 - 5 - 6) and another shorter path (7 - 8).

These test cases should help expose any issues in the code's handling of the tree structure and queries.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define B break
#define C continue
#define F first
#define S second
#define pb push_back
#define yes cout<<"YES\n";
#define no cout<<"NO\n";
#define fast ios_base::sync_with_stdio(NULL); cin.tie(0); cout.tie(0);
using namespace std;
int const N=1e6+40;
int const NN=998244353;
ll t,n,k,mx,mi,h,l[N],r[N],x,y,z,sum,ans,a[N],b[N],c[N];
bool vis[N];
int main()
{
    cin>>t;
    while(t--){
        cin>>n;
        set<ll>s={1};
        int i=2;
        b[1]=1;
        while(i<n){
            cout<<"? 1 "<<i<<endl;
            cin>>x;
            if(x){
                c[i]=0;
                b[i]=i;
                s.insert(i);
                ++i;
            }
            else B;
        }
        c[i]=1;
        i++;
        while(i<n){
            vector<ll>v;
            for(auto e:s){
                cout<<"? "<<e<<" "<<i<<endl;
                cin>>x;
                if(x==0){
                    c[i]=b[e];
                    b[e]=i;
                    i++;
                }
                else v.pb(e);
                if(i==n)B;
            }
            for(int j=0;j<v.size();j++)
                s.erase(v[j]);
        }
        cout<<"! ";
        for(int i=1;i<n;i++)cout<<c[i]<<" ";
        cout<<endl;
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To expose the bug in the given code, we need to craft a test input that specifically targets the logic flaws in the algorithm. The key points to consider are:

1. The code assumes that the node 1 has exactly two adjacent nodes, including node 0. This means node 1 must have another node connected to it besides node 0.
2. The code uses a set to keep track of nodes that are directly connected to the root node 0.
3. The code queries the containment cell to check if the path between two nodes contains node 0.
4. The code fails to handle cases where the structure of the tree does not conform to the expected pattern, especially when the path between nodes does not contain node 0.

Let's construct a small-scale test input that can expose these issues:

1. **Test Case 1: Simple Tree with Node 1 Having Two Adjacent Nodes**
   - This should be a straightforward case where node 1 has exactly two adjacent nodes (0 and another node).
   - Example: A tree with 4 nodes where node 1 is connected to node 2 and node 3.

2. **Test Case 2: Tree with Node 1 Having More Than Two Adjacent Nodes**
   - This case should expose the bug where the code assumes node 1 has exactly two adjacent nodes.
   - Example: A tree with 5 nodes where node 1 is connected to node 2, node 3, and node 4.

3. **Test Case 3: Tree with Node 1 Having Only One Adjacent Node**
   - This case should expose the bug where the code assumes node 1 has exactly two adjacent nodes.
   - Example: A tree with 5 nodes where node 1 is only connected to node 2.

4. **Test Case 4: Tree with Complex Structure**
   - This case should expose the bug where the code fails to handle more complex tree structures.
   - Example: A tree with 7 nodes where the structure is more complex and node 1 has exactly two adjacent nodes, but the paths are not straightforward.

Here is the test input that combines these scenarios:

```plaintext
4
4
1
5
1
0
5
1
1
0
7
1
1
1
1
1
1
```

Explanation:
- **Test Case 1 (n = 4):**
  - Node 0 is the root.
  - Node 1 is connected to node 2 and node 3.
  - Node 2 and node 3 are leaf nodes.
- **Test Case 2 (n = 5):**
  - Node 0 is the root.
  - Node 1 is connected to node 2, node 3, and node 4.
  - Node 2, node 3, and node 4 are leaf nodes.
- **Test Case 3 (n = 5):**
  - Node 0 is the root.
  - Node 1 is only connected to node 2.
  - Node 2 is a leaf node.
- **Test Case 4 (n = 7):**
  - Node 0 is the root.
  - Node 1 is connected to node 2 and node 3.
  - Node 2 is connected to node 4 and node 5.
  - Node 3 is connected to node 6 and node 7.
  - Node 4, node 5, node 6, and node 7 are leaf nodes.

This test input should help expose the bugs in the given code by challenging its assumptions and handling of different tree structures.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
# Author: Colin Rolance D
import sys
from collections import *
from heapq import *
from bisect import *
from math import *

# def input():
#     return sys.stdin.readline().strip()

def query(a,b):
    print("? {} {}".format(a,b))
    sys.stdout.flush()
    return int(input())

def main():
    t = int(input())
    for _ in range(t):
        n = int(input())
        A = []
        O = []
        for i in range(2,n):
            res = query(i, 1)
            if res:
                A += [i]
            else:
                O += [i]
        ans = [0] * n
        p = O[0] - 1
        # print(O)
        # print(p)
        par = 1
        T = defaultdict(list)
        for i in range(O[0],O[-1]+1):
            T[par] += [i]
            par = (par + 1) % p
            if not par:
                par = p
        if O[-1]!=n-1:
            val = O[-1] + 1
            for par in range(2,p+1):
                while val<n and not query(val,par):
                    T[par] += [val]
                    val += 1
            par = p
            while val<n:
                T[par] += [val]
                val += 1
        # print(T)
        for i in T:
            par = i
            for j in T[i]:
                ans[j] = par
                par = j
        ans.pop(0)
        print("!", *ans)

if __name__ == "__main__":
    main()

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided buggy code, we need to consider the constraints and the specific logic of the code. The code has several potential issues, including how it handles the queries and the construction of the tree. Here are the steps to create a test input:

1. **Understand the Code's Logic**:
   - The code uses a series of queries to determine the structure of the tree.
   - It divides the nodes into two categories: `A` (nodes that are connected to the root via a path that includes the root) and `O` (nodes that are not directly connected to the root via such a path).

2. **Identify Potential Bugs**:
   - The code assumes that the nodes in `O` are all in a specific order, which might not always be the case.
   - The code might not handle cases where the tree structure is more complex or where the nodes are not perfectly balanced.

3. **Create a Test Case**:
   - We need a small-scale test case that can expose these issues.
   - A good test case would have a tree structure that is not straightforward and might cause the code to misinterpret the queries.

Here is a test input that could expose the bug:

```plaintext
1
7
? 2 3
? 2 4
? 2 5
? 2 6
? 3 4
? 3 5
? 3 6
? 4 5
? 4 6
? 5 6
! 0 1 2 3 4 5 6
```

### Explanation:
- **Test Case Description**:
  - The tree has 7 nodes.
  - Node 0 is the root.
  - Node 1 has exactly two adjacent nodes (including node 0).
  - The tree is structured in a way that is not straightforward, with multiple paths and nodes that might not follow the simple linear structure assumed by the code.

- **Queries**:
  - The queries are designed to test the structure of the tree and see if the code can correctly determine the parent-child relationships.
  - The queries are designed to cover all possible paths and ensure that the code must correctly interpret the results.

- **Expected Output**:
  - The expected output is a list of parent indices for each node (excluding the root node 0).

This test case should help identify any issues in the code's logic, particularly in how it handles the queries and constructs the tree.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
import sys
# comment this line for interactive problems
# input = sys.stdin.readline
I = lambda : list(map(int,input().split()))
from bisect import bisect_right
from collections import Counter

def query(a,b):
	print("?",a,b, flush = True)
	an, = I()
	return an

t, = I()
for _ in range(t):
	n, = I()
	parent = [0]*(n-1)
	direct = [1]
	for i in range(n-2):
		r = query(1,i+2)
		if r == 0:
			parent[i+1]=1
			break
		direct.append(i+2)
	child = direct[-1]+1
	direct[0] = child
	valid = [1]*len(direct)
	last_path = 0
	for i in range(child+1,n):
		cur_path = -2
		for x in range(len(direct)):
			if valid[x]:
				r = query(direct[x],i) if (x != len(direct)-1) else 0
				if r == 0:
					# print(x, i,direct, direct[x])
					parent[i-1] = direct[x]
					direct[x] = i
					cur_path = x
					break
				if x > last_path:
					valid[x] = 0
		if (last_path == cur_path):
			for xx in range(last_path):
				valid[xx]=0
			if (cur_path == (len(direct) - 1)):
				for val in range(i,n-1):
					parent[val] = val
				break
		last_path = cur_path
	print("!",*parent)

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
```plaintext
3
4
1
5
1
0
9
```

This test input is designed to challenge the buggy code by including:

1. A small tree with 4 nodes to test basic functionality.
2. A slightly larger tree with 5 nodes to test the edge case where the node 1 has exactly two adjacent nodes (including node 0).
3. A larger tree with 9 nodes to test more complex scenarios and the interaction with the query limits.

The input is small enough to be manageable but comprehensive enough to expose potential bugs in the code.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.TreeSet;

public class Main {

	static class Scanner {
		Scanner(InputStream in) { this.in = in; } InputStream in;
		byte[] bb = new byte[200000 * 19]; int i, n;
		byte getc() {
			if (i == n) {
				i = n = 0;
				try { n = in.read(bb); } catch (IOException e) {}
			}
			return i < n ? bb[i++] : 0;
		}
		int nextInt() {
			byte c = 0; while (c <= ' ') c = getc();
			boolean negate = false;
			if (c == '-') {
				negate = true;
				c = getc();
			}
			int a = 0; while (c > ' ') { a = a * 10 + c - '0'; c = getc(); }
			if (negate) a = -a;
			return a;
		}

		long nextLong() {
			byte c = 0; while (c <= ' ') c = getc();
			long a = 0; while (c > ' ') { a = a * 10 + c - '0'; c = getc(); }
			return a;
		}
	}

	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in), 200000 * 20);
		BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out), 50000000);

		int T = Integer.parseInt(in.readLine());

		for (int ts=1; ts<=T; ts++) {

			int N = Integer.parseInt(in.readLine());

			int i = 2;
			int[] P = new int[N+3];

			for (;i<=N; i++) {
				out.write("? 1 " + i + "\n");
				out.flush();
				int r = Integer.parseInt(in.readLine());

				if (r == -1) {
					return;
				}
				if (r == 0) {
					//one has 2 neightbors, so we will break at some point
					break;
				}
			}

			int[] arr = new int[i];
			arr[1] = i;
			for (int j=2; j<i; j++) {
				arr[j] = j;
			}

			P[1] = 0;
			P[i] = 1;
			for (int j=2; j<i; j++) {
				P[j] = 0;
			}
			//

			int idx = 1;
			for (; i+1<N; i++) {
				while (true) {
					//get location of (i+1)
					out.write("? " + arr[idx] + " " + (i+1) + "\n");
					out.flush();
					int r = Integer.parseInt(in.readLine());
					if (r == -1) {
						return;
					}

					if (r == 1) {
						idx++;
					} else {
						P[i+1] = arr[idx];
						arr[idx] = i+1;
						break;
					}
				}

			}

			out.write("!");
			for (int j=1; j<N; j++) {
				out.write(" " + P[j]);
			}
			out.write("\n");
			out.flush();

		}

		in.close();
		out.close();
	}
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To generate a challenging test input that exposes the bug in the provided code, we need to focus on edge cases and scenarios that can maximize the failure probability. The code provided has several potential issues, including how it handles the structure of the tree and the queries it makes. Let's break down the problem and identify a suitable test case.

### Key Points to Consider:
1. **Tree Structure**: The tree must satisfy the conditions given in the problem description.
2. **Query Limit**: The code should not exceed the query limit of \(2n - 6\).
3. **Edge Cases**: The tree should have a structure that can confuse the algorithm, especially when it comes to determining the parent nodes.

### Challenging Test Case:
Let's consider a tree with \(n = 6\) nodes. We will design the tree such that the queries made by the code can lead to incorrect results.

### Tree Structure:
- Node 0 (root) is connected to nodes 1 and 2.
- Node 1 is connected to nodes 3 and 4.
- Node 2 is connected to node 5.

### Expected Output:
- The parent array should be: \(p = [0, 0, 1, 1, 1, 2]\).

### Test Input:
```plaintext
1
6
```

### Explanation:
- **Query Sequence**:
  1. The code will start with node 1 and node 2.
  2. It will query "? 1 2" and get the response 1 (since the path between 1 and 2 contains node 0).
  3. It will then move to node 3 and query "? 1 3". The response should be 1 (since the path between 1 and 3 contains node 0).
  4. It will move to node 4 and query "? 1 4". The response should be 1 (since the path between 1 and 4 contains node 0).
  5. It will move to node 5 and query "? 1 5". The response should be 0 (since the path between 1 and 5 does not contain node 0).

### Expected Behavior:
- The code should correctly determine the parent array as \(p = [0, 0, 1, 1, 1, 2]\).

### Challenging Aspect:
- The code must correctly handle the fact that node 1 has exactly two adjacent nodes (0 and another node).
- The code must correctly determine the parent of node 5, which is not directly connected to node 1.

### Test Input:
```plaintext
1
6
```

This test input will help expose any issues in the code's handling of the tree structure and query responses.


**Task:**
Generate a challenging test input that exposes the bug in the buggy code of the algorithm problem:
Algorithm Problem:
Title: Genokraken
time_limit_ms: 2000
memory_limit_mb: 256
Description: This is an interactive problem.

Upon clearing the Waterside Area, Gretel has found a monster named Genokraken, and she's keeping it contained for her scientific studies.

The monster's nerve system can be structured as a tree$$$^{\dagger}$$$ of $$$n$$$ nodes (really, everything should stop resembling trees all the time$$$\ldots$$$), numbered from $$$0$$$ to $$$n-1$$$, with node $$$0$$$ as the root.

Gretel's objective is to learn the exact structure of the monster's nerve system — more specifically, she wants to know the values $$$p_1, p_2, \ldots, p_{n-1}$$$ of the tree, where $$$p_i$$$ ($$$0 \le p_i < i$$$) is the direct parent node of node $$$i$$$ ($$$1 \le i \le n - 1$$$).

She doesn't know exactly how the nodes are placed, but she knows a few convenient facts:

- If we remove root node $$$0$$$ and all adjacent edges, this tree will turn into a forest consisting of only paths$$$^{\ddagger}$$$. Each node that was initially adjacent to the node $$$0$$$ will be the end of some path.
- The nodes are indexed in a way that if $$$1 \le x \le y \le n - 1$$$, then $$$p_x \le p_y$$$.
- Node $$$1$$$ has exactly two adjacent nodes (including the node $$$0$$$).

The tree in this picture does not satisfy the condition, because if we remove node $$$0$$$, then node $$$2$$$ (which was initially adjacent to the node $$$0$$$) will not be the end of the path $$$4-2-5$$$.The tree in this picture does not satisfy the condition, because $$$p_3 \le p_4$$$ must hold.The tree in this picture does not satisfy the condition, because node $$$1$$$ has only one adjacent node.

Gretel can make queries to the containment cell:

- "? a b" ($$$1 \le a, b < n$$$, $$$a \ne b$$$) — the cell will check if the simple path between nodes $$$a$$$ and $$$b$$$ contains the node $$$0$$$.

However, to avoid unexpected consequences by overstimulating the creature, Gretel wants to query at most $$$2n - 6$$$ times. Though Gretel is gifted, she can't do everything all at once, so can you give her a helping hand?

$$$^{\dagger}$$$A tree is a connected graph where every pair of distinct nodes has exactly one simple path connecting them.

$$$^{\ddagger}$$$A path is a tree whose vertices can be listed in the order $$$v_1, v_2, \ldots, v_k$$$ such that the edges are $$$(v_i, v_{i+1})$$$ ($$$1 \le i < k$$$).

Input: Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains a single integer $$$n$$$ ($$$4 \le n \le 10^4$$$) — the number of nodes in Genokraken's nerve system.

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

Output: None

Examples:
input:
3
4

1

5

1

0

9
output:
? 2 3

! 0 0 1

? 2 3

? 2 4

! 0 0 1 2

! 0 0 0 1 3 5 6 7

Note: In the first test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.

In the second test case, Genokraken's nerve system forms the following tree:

- The answer to "? 2 3" is $$$1$$$. This means that the simple path between nodes $$$2$$$ and $$$3$$$ contains node $$$0$$$.
- The answer to "? 2 4" is $$$0$$$. This means that the simple path between nodes $$$2$$$ and $$$4$$$ doesn't contain node $$$0$$$.

In the third test case, Genokraken's nerve system forms the following tree:

Buggy Code:
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    int[] parents =new int[200005];

    public static void main(String[] args) {
        new Thread(null, new Main(), "", 256 * (1L << 20)).start();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            if (System.getProperty("ONLINE_JUDGE") != null) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            }
            Locale.setDefault(Locale.US);
            solve();
            in.close();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    //Util Functions
    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    ArrayList<Integer> readIntArrayList(int length) throws IOException {
        ArrayList array = new ArrayList();
        for(int input = 0; input < length; input++){
            array.add(readInt());
        }
        return array;
    }

    int[] readIntList(int length) throws IOException {
        int[] array = new int[length];
        for(int input = 0; input < length; input++){
            array[input] = readInt();
        }
        return array;
    }

    void readIntList(int[] array,int length) throws IOException {
        for(int input = 0; input < length; input++){
            array[input] = readInt();
        }
    }

    // Helper functions

    int[] bitsRep(int n){
        int[] bits = new int[22];
        int i = 0;
        while(n > 0){
            bits[i++] = n % 2;
            n = n / 2;
        }
        return bits;
    }

    boolean[] bitsBool(int[] intArray){
        boolean[] bits = new boolean[intArray.length];
        for(int i = 0; i < intArray.length; i++)
            bits[i] = intArray[i] > 0;

        return bits;
    }

    int[] arrayTopla(int[] a, int[] b){
        int[] sum = new int[Math.max(a.length,b.length)];
        for(int i = 0; i < sum.length; i++){
            if(i < a.length){
                sum[i] += a[i];
            }
            if(i < b.length){
                sum[i] += b[i];
            }
        }
        return sum;
    }

    int[] arrayCikar(int[] a, int[] b){
        int[] fark = new int[Math.max(a.length,b.length)];
        for(int i = 0; i < fark.length; i++){
            if(i < a.length){
                fark[i] += a[i];
            }
            if(i < b.length){
                fark[i] -= b[i];
            }
        }
        return fark;
    }
    // Helper Class

    int binarySearch(List<Integer> list, int eleman) {
        int l = 0;
        int r = list.size();
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (list.get(m) > eleman) {
                r = m;
            } else {
                l = m;
            }
        }
        if(list.size() <= l){
            return -1;
        }
        if(list.get(l) <= eleman){
            if(list.size() == l + 1)
                return -1;
            else{
                return l + 1;
            }
        }
        return l;
    }

    int binarySearch(Long[] list, int eleman,int length) {
        int l = 0;
        int r = length;
        while (r - l > 1) {
            int m = (l + r) / 2;
            if (list[m] > eleman) {
                r = m;
            } else {
                l = m;
            }
        }
        if(list[l] <= eleman){
            return l + 1;
        }
        return l;
    }

    public int query(int k, int node) throws IOException {
        System.out.println(String.format("? %d %d", k, node));
        System.out.flush();
        // Return statement needed for an int method; adjust as per your requirements
        int cevap = readInt();
        if(cevap == -1)
            System.exit(0);
        return cevap; // or some other appropriate value
    }
    void solve() throws IOException {
        int t = readInt();
        for (int problem = 0; problem < t; problem++){
            int n = readInt();
            parents[0] = 0;
            parents[1] = 0;
            Node dalinSonu = new Node(1);
            dalinSonu.prev = dalinSonu;
            int k = 2;
            Node iter = dalinSonu;
            while(query(k,1) == 1){
                parents[k] = 0;
                iter = iter.add(k++);
            }
            dalinSonu.value= k;
            parents[k++] = 1;
            boolean flag = true;
            while(k < n){
                iter = dalinSonu;
                if(flag){
                    iter = iter.next;
                    flag = false;
                }
                while(iter != null){
                    if(query(k,iter.value) == 0){
                        parents[k] = iter.value;
                        iter.value = k++;
                        iter = iter.next;
                    }
                    else{
                        if(iter.value == dalinSonu.value){
                            iter = dalinSonu.next;
                            dalinSonu = dalinSonu.next;
                        }
                        else{
                        iter.prev.next = iter.next;
                        iter = iter.next;
                        }
                    }
                }
            }
            String output = "! ";
            for(int i = 1; i < n; i++){
                output = output + parents[i] + " ";
            }
            System.out.println(output);
            System.out.flush();
        }
    }

    public class Node{
        int value;
        Node next;
        Node prev;

        public Node(int value) {
            this.value = value;
        }
        public Node add(int value){
            this.next = new Node(value);
            this.next.prev = this;
            return this.next;
        }
    }
}

**Instructions:**
- Focus on edge cases or scenarios that maximize the failure probability in faulty solutions.
- Due to the output length limit, you should generate a **small-scale** test input that is **complete and valid**.
- Output the test input directly, not code to generate it.

**Output format:**
```plaintext
{test input}
```

Think step by step.

Response:
To create a challenging test input that exposes the bug in the provided buggy code, we need to consider the constraints and properties of the problem:

1. **Tree Structure**: The tree must be a valid tree with node 0 as the root.
2. **Paths After Removing Node 0**: Removing node 0 should leave a forest of paths.
3. **Node 1**: Node 1 must have exactly two adjacent nodes, one of which is node 0.
4. **Query Limit**: The solution should not exceed 2n - 6 queries.

Given these constraints, a good test case would be a tree where the structure is complex enough to challenge the algorithm, especially in terms of the query mechanism and the way nodes are added to the paths.

### Test Case:
Let's consider a tree with 9 nodes (n = 9) that meets all the criteria:

- Node 0 is the root.
- Node 1 has two adjacent nodes: node 0 and node 2.
- Node 2 is the start of a path: 2 -> 3 -> 4.
- Node 3 is the start of a path: 3 -> 5.
- Node 4 is the start of a path: 4 -> 6.
- Node 5 is the start of a path: 5 -> 7.
- Node 6 is the start of a path: 6 -> 8.

This tree structure should be challenging because it requires the algorithm to correctly identify the paths and their connections.

### Test Input:
```plaintext
1
9
```

### Explanation:
- **Number of Test Cases**: 1
- **Number of Nodes**: 9

### Expected Tree Structure:
- Node 0: (root)
- Node 1: 0, 2
- Node 2: 1, 3
- Node 3: 2, 5
- Node 4: 2, 6
- Node 5: 3, 7
- Node 6: 4, 8
- Node 7: 5
- Node 8: 6

### Expected Output:
```plaintext
? 2 3
? 3 4
? 2 4
? 3 5
? 4 5
? 4 6
? 5 6
? 5 7
? 6 7
? 6 8
! 0 0 1 2 2 2 3 3 4
```

This test case should expose any issues in the algorithm's ability to correctly identify the parent nodes and handle the queries efficiently. The structure is complex enough to challenge the algorithm's logic, especially in terms of the path identification and query handling.