#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9;
const long long MOD = 1e9 + 7;
mt19937 azino(777);
int ask(int a, int b, int c) {
  cout << "? " << a << " " << b << " " << c << endl;
  int x;
  cin >> x;
  return x;
}
void answer(vector<int>& ans) {
  cout << "! " << ans.size() << " ";
  for (auto& it : ans) cout << it << " ";
  cout << endl;
  return;
}
vector<int> pp(int pos0, int pos1, int pos, int type) {
  vector<int> p(3, -1);
  if (type == 0) {
    int c1 = ask(pos1, pos, pos + 1);
    int c2 = ask(pos1, pos, pos + 2);
    if (c1 == c2) {
      if (c1 == 0) p[0] = p[1] = p[2] = 0;
      if (c1 == 1) p[0] = 1, p[1] = p[2] = 0;
    } else {
      if (c1 == 0) p[0] = p[1] = 0;
      if (c2 == 0) p[0] = p[2] = 0;
      for (auto& i : p)
        if (i == -1) i = 1;
    }
  } else {
    int c1 = ask(pos0, pos, pos + 1);
    int c2 = ask(pos0, pos, pos + 2);
    if (c1 == c2 && c1 == 1)
      p[0] = p[1] = p[2] = 1;
    else if (c1 == c2 && c1 == 0)
      p[0] = 0, p[1] = p[2] = 1;
    else {
      if (c1 == 1) p[0] = p[1] = 1;
      if (c2 == 1) p[0] = p[2] = 1;
      for (auto& i : p)
        if (i == -1) i = 0;
    }
  }
  return p;
}
void solve() {
  int n;
  cin >> n;
  vector<int> z(n);
  int pos0 = 0, pos1 = 0;
  for (int i = 0; i < n; i += 3) {
    z[i] = ask(i + 1, i + 2, i + 3);
    if (z[i])
      pos1 = i;
    else
      pos0 = i;
  }
  vector<int> p0(3, -1), p1(3, -1);
  int c1 = ask(pos1 + 1, pos1 + 2, pos0 + 1);
  int c2 = ask(pos1 + 1, pos1 + 2, pos0 + 2);
  int poss0 = -1, poss1 = -1;
  if (c1 == c2) {
    if (c1 == 0)
      p0[0] = p0[1] = 0;
    else
      p1[0] = p1[1] = 1;
  } else {
    p0[0] = c1, p0[1] = c2;
    if (c1 == 0)
      poss0 = pos0 + 1;
    else
      poss1 = pos0 + 1;
    if (c2 == 0)
      poss0 = pos0 + 2;
    else
      poss1 = pos0 + 2;
  }
  if (p0[0] == -1) {
    c1 = ask(pos1 + 1, pos0 + 1, pos0 + 2);
    c2 = ask(pos1 + 1, pos0 + 1, pos0 + 3);
    if (c1 == c2 && c1 == 0)
      p0[0] = p0[1] = p0[2] = 0;
    else if (c1 == c2 && c1 == 1)
      p0[0] = 1, p0[1] = p0[2] = 0;
    else {
      if (c1 == 0) p0[0] = p0[1] = 0;
      if (c2 == 0) p0[0] = p0[2] = 0;
      for (auto& i : p0)
        if (i == -1) i = 1;
    }
    for (int i = 0; i < 3; ++i)
      if (p0[i] == 0)
        poss0 = pos0 + 1 + i;
      else
        poss1 = pos0 + 1 + i;
    c1 = ask(poss0, pos1 + 1, pos1 + 2);
    c2 = ask(poss0, pos1 + 1, pos1 + 3);
    if (c1 == c2) {
      if (c1 == 1) p1[0] = p1[1] = p1[2] = 1;
      if (c1 == 0) p1[0] = 0, p1[1] = p1[2] = 1;
    } else {
      if (c1 == 1) p1[0] = p1[1] = 1;
      if (c2 == 1) p1[0] = p1[2] = 1;
      for (auto& i : p1)
        if (i == -1) i = 0;
    }
    for (int i = 0; i < 3; ++i)
      if (p1[i] == 0)
        poss0 = pos1 + 1 + i;
      else
        poss1 = pos1 + 1 + i;
  } else {
    if (poss0 != -1) {
      for (int i = 0; i < 3; ++i) p1[i] = ask(poss1, poss0, pos1 + 1 + i);
      p0[2] = ask(poss1, poss0, pos0 + 3);
    } else {
      c1 = ask(pos0 + 1, pos1 + 1, pos1 + 2);
      c2 = ask(pos0 + 1, pos1 + 1, pos1 + 3);
      if (c1 == c2 && c1 == 1)
        p1[0] = p1[1] = p1[2] = 1;
      else if (c1 == c2 && c1 == 0)
        p1[0] = 0, p1[1] = p1[2] = 1;
      else {
        if (c1 == 1) p1[0] = p1[1] = 1;
        if (c2 == 1) p1[0] = p1[2] = 1;
        for (auto& i : p1)
          if (i == -1) i = 0;
      }
      for (int i = 0; i < 3; ++i)
        if (p1[i] == 0)
          poss0 = pos1 + 1 + i;
        else
          poss1 = pos1 + 1 + i;
      c1 = ask(poss1, pos0 + 1, pos0 + 2);
      c2 = ask(poss1, pos0 + 1, pos0 + 3);
      if (c1 == c2) {
        if (c1 == 0) p0[0] = p0[1] = p0[2] = 0;
        if (c1 == 1) p0[0] = 1, p0[1] = p0[2] = 0;
      } else {
        if (c1 == 0) p0[0] = p0[1] = 0;
        if (c2 == 0) p0[0] = p0[2] = 0;
        for (auto& i : p0)
          if (i == -1) i = 1;
      }
      for (int i = 0; i < 3; ++i)
        if (p0[i] == 0)
          poss0 = pos0 + 1 + i;
        else
          poss1 = pos0 + 1 + i;
    }
  }
  vector<int> ans;
  for (int i = 0; i < 3; ++i)
    if (p0[i] == 0) ans.emplace_back(pos0 + i + 1);
  for (int i = 0; i < 3; ++i)
    if (p1[i] == 0) ans.emplace_back(pos1 + i + 1);
  for (int i = 0; i < n; i += 3) {
    if (i == pos0 || i == pos1) continue;
    auto it = pp(poss0, poss1, i + 1, z[i]);
    for (int j = 0; j < 3; ++j)
      if (it[j] == 0) ans.emplace_back(i + 1 + j);
  }
  answer(ans);
}
signed main() {
  cout << fixed << setprecision(15);
  int t;
  cin >> t;
  while (t-- > 0) {
    solve();
    cout << '\n';
  }
  return 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

This is an interactive problem. The only difference between the easy and hard version is the limit on number of questions.

There are n players labelled from 1 to n. It is guaranteed that n is a multiple of 3.

Among them, there are k impostors and n-k crewmates. The number of impostors, k, is not given to you. It is guaranteed that n/3 < k < 2n/3.

In each question, you can choose three distinct integers a, b, c (1 ≤ a, b, c ≤ n) and ask: "Among the players labelled a, b and c, are there more impostors or more crewmates?" You will be given the integer 0 if there are more impostors than crewmates, and 1 otherwise.

Find the number of impostors k and the indices of players that are impostors after asking at most n+6 questions.

The jury is adaptive, which means the indices of impostors may not be fixed beforehand and can depend on your questions. It is guaranteed that there is at least one set of impostors which fulfills the constraints and the answers to your questions at any time.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 100). Description of the test cases follows.

The first and only line of each test case contains a single integer n (6 ≤ n < 10^4, n is a multiple of 3) — the number of players.

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

Interaction

For each test case, the interaction starts with reading n.

Then you are allowed to make at most n+6 questions in the following way:

"? a b c" (1 ≤ a, b, c ≤ n, a, b and c are pairwise distinct).

After each one, you should read an integer r, which is equal to 0 if there are more impostors than crewmates among players labelled a, b and c, and equal to 1 otherwise.

Answer -1 instead of 0 or 1 means that you made an invalid query. Exit immediately after receiving -1 and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream.

When you have found the indices of all impostors, print a single line "! " (without quotes), followed by the number of impostors k, followed by k integers representing the indices of the impostors. Please note that you must print all this information on the same line. 

After printing the answer, your program must then continue to solve the remaining test cases, or exit if all test cases have been solved.

After printing the queries and answers do not forget to output end of line and flush the output buffer. Otherwise, you will get the Idleness limit exceeded verdict. To do flush use:

  * fflush(stdout) or cout.flush() in C++; 
  * System.out.flush() in Java; 
  * flush(output) in Pascal; 
  * stdout.flush() in Python; 
  * Read documentation for other languages. 



Hacks

You cannot make hacks in this problem.

Example

Input


2
6

0

1

9

1

Output


? 1 2 3

? 3 4 5

! 3 4 1 2

? 7 1 9

! 4 2 3 6 8

Note

Explanation for example interaction (note that this example only exists to demonstrate the interaction procedure and does not provide any hint for the solution):

For the first test case:

Question "? 1 2 3" returns 0, so there are more impostors than crewmates among players 1, 2 and 3.

Question "? 3 4 5" returns 1, so there are more crewmates than impostors among players 3, 4 and 5.

Outputting "! 3 4 1 2" means that one has found all the impostors, by some miracle. There are k = 3 impostors. The players who are impostors are players 4, 1 and 2.

For the second test case:

Question "? 7 1 9" returns 1, so there are more crewmates than impostors among players 7, 1 and 9.

Outputting "! 4 2 3 6 8" means that one has found all the impostors, by some miracle. There are k = 4 impostors. The players who are impostors are players 2, 3, 6 and 8.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
const long long INF = 2e9;
const long long MOD = 1e9 + 7;
mt19937 azino(777);
int ask(int a, int b, int c) {
  cout << "? " << a << " " << b << " " << c << endl;
  int x;
  cin >> x;
  return x;
}
void answer(vector<int>& ans) {
  cout << "! " << ans.size() << " ";
  for (auto& it : ans) cout << it << " ";
  cout << endl;
  return;
}
vector<int> pp(int pos0, int pos1, int pos, int type) {
  vector<int> p(3, -1);
  if (type == 0) {
    int c1 = ask(pos1, pos, pos + 1);
    int c2 = ask(pos1, pos, pos + 2);
    if (c1 == c2) {
      if (c1 == 0) p[0] = p[1] = p[2] = 0;
      if (c1 == 1) p[0] = 1, p[1] = p[2] = 0;
    } else {
      if (c1 == 0) p[0] = p[1] = 0;
      if (c2 == 0) p[0] = p[2] = 0;
      for (auto& i : p)
        if (i == -1) i = 1;
    }
  } else {
    int c1 = ask(pos0, pos, pos + 1);
    int c2 = ask(pos0, pos, pos + 2);
    if (c1 == c2 && c1 == 1)
      p[0] = p[1] = p[2] = 1;
    else if (c1 == c2 && c1 == 0)
      p[0] = 0, p[1] = p[2] = 1;
    else {
      if (c1 == 1) p[0] = p[1] = 1;
      if (c2 == 1) p[0] = p[2] = 1;
      for (auto& i : p)
        if (i == -1) i = 0;
    }
  }
  return p;
}
void solve() {
  int n;
  cin >> n;
  vector<int> z(n);
  int pos0 = 0, pos1 = 0;
  for (int i = 0; i < n; i += 3) {
    z[i] = ask(i + 1, i + 2, i + 3);
    if (z[i])
      pos1 = i;
    else
      pos0 = i;
  }
  vector<int> p0(3, -1), p1(3, -1);
  int c1 = ask(pos1 + 1, pos1 + 2, pos0 + 1);
  int c2 = ask(pos1 + 1, pos1 + 2, pos0 + 2);
  int poss0 = -1, poss1 = -1;
  if (c1 == c2) {
    if (c1 == 0)
      p0[0] = p0[1] = 0;
    else
      p1[0] = p1[1] = 1;
  } else {
    p0[0] = c1, p0[1] = c2;
    if (c1 == 0)
      poss0 = pos0 + 1;
    else
      poss1 = pos0 + 1;
    if (c2 == 0)
      poss0 = pos0 + 2;
    else
      poss1 = pos0 + 2;
  }
  if (p0[0] == -1) {
    c1 = ask(pos1 + 1, pos0 + 1, pos0 + 2);
    c2 = ask(pos1 + 1, pos0 + 1, pos0 + 3);
    if (c1 == c2 && c1 == 0)
      p0[0] = p0[1] = p0[2] = 0;
    else if (c1 == c2 && c1 == 1)
      p0[0] = 1, p0[1] = p0[2] = 0;
    else {
      if (c1 == 0) p0[0] = p0[1] = 0;
      if (c2 == 0) p0[0] = p0[2] = 0;
      for (auto& i : p0)
        if (i == -1) i = 1;
    }
    for (int i = 0; i < 3; ++i)
      if (p0[i] == 0)
        poss0 = pos0 + 1 + i;
      else
        poss1 = pos0 + 1 + i;
    c1 = ask(poss0, pos1 + 1, pos1 + 2);
    c2 = ask(poss0, pos1 + 1, pos1 + 3);
    if (c1 == c2) {
      if (c1 == 1) p1[0] = p1[1] = p1[2] = 1;
      if (c1 == 0) p1[0] = 0, p1[1] = p1[2] = 1;
    } else {
      if (c1 == 1) p1[0] = p1[1] = 1;
      if (c2 == 1) p1[0] = p1[2] = 1;
      for (auto& i : p1)
        if (i == -1) i = 0;
    }
    for (int i = 0; i < 3; ++i)
      if (p1[i] == 0)
        poss0 = pos1 + 1 + i;
      else
        poss1 = pos1 + 1 + i;
  } else {
    if (poss0 != -1) {
      for (int i = 0; i < 3; ++i) p1[i] = ask(poss1, poss0, pos1 + 1 + i);
      p0[2] = ask(poss1, poss0, pos0 + 3);
    } else {
      c1 = ask(pos0 + 1, pos1 + 1, pos1 + 2);
      c2 = ask(pos0 + 1, pos1 + 1, pos1 + 3);
      if (c1 == c2 && c1 == 1)
        p1[0] = p1[1] = p1[2] = 1;
      else if (c1 == c2 && c1 == 0)
        p1[0] = 0, p1[1] = p1[2] = 1;
      else {
        if (c1 == 1) p1[0] = p1[1] = 1;
        if (c2 == 1) p1[0] = p1[2] = 1;
        for (auto& i : p1)
          if (i == -1) i = 0;
      }
      for (int i = 0; i < 3; ++i)
        if (p1[i] == 0)
          poss0 = pos1 + 1 + i;
        else
          poss1 = pos1 + 1 + i;
      c1 = ask(poss1, pos0 + 1, pos0 + 2);
      c2 = ask(poss1, pos0 + 1, pos0 + 3);
      if (c1 == c2) {
        if (c1 == 0) p0[0] = p0[1] = p0[2] = 0;
        if (c1 == 1) p0[0] = 1, p0[1] = p0[2] = 0;
      } else {
        if (c1 == 0) p0[0] = p0[1] = 0;
        if (c2 == 0) p0[0] = p0[2] = 0;
        for (auto& i : p0)
          if (i == -1) i = 1;
      }
      for (int i = 0; i < 3; ++i)
        if (p0[i] == 0)
          poss0 = pos0 + 1 + i;
        else
          poss1 = pos0 + 1 + i;
    }
  }
  vector<int> ans;
  for (int i = 0; i < 3; ++i)
    if (p0[i] == 0) ans.emplace_back(pos0 + i + 1);
  for (int i = 0; i < 3; ++i)
    if (p1[i] == 0) ans.emplace_back(pos1 + i + 1);
  for (int i = 0; i < n; i += 3) {
    if (i == pos0 || i == pos1) continue;
    auto it = pp(poss0, poss1, i + 1, z[i]);
    for (int j = 0; j < 3; ++j)
      if (it[j] == 0) ans.emplace_back(i + 1 + j);
  }
  answer(ans);
}
signed main() {
  cout << fixed << setprecision(15);
  int t;
  cin >> t;
  while (t-- > 0) {
    solve();
    cout << '\n';
  }
  return 0;
}

```