#include using namespace std; int cnt, limit; void ask(int a, int b, int c, int d, int e, int &x, int &y) { ++cnt; assert(cnt <= limit); cout << "? " << a << ' ' << b << ' ' << c << ' ' << d << ' ' << e << endl; assert(cin >> x >> y); } int solve(vector v) { int x, y; if (v.size() == 6) { map , map > M; map , int> C; ask(v[0], v[1], v[2], v[3], v[4], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[5]]; ask(v[0], v[1], v[2], v[3], v[5], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[4]]; ask(v[0], v[1], v[2], v[4], v[5], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[3]]; ask(v[0], v[1], v[3], v[4], v[5], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[2]]; ask(v[0], v[2], v[3], v[4], v[5], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[1]]; ask(v[1], v[2], v[3], v[4], v[5], x, y); ++C[{x, y}]; for (int k = 0; k < 6; ++k) ++M[{x, y}][v[k]]; --M[{x, y}][v[0]]; for (auto it: C) { if (it.second == 3) { x = it.first.first, y = it.first.second; for (auto it: M[{x, y}]) { if (it.first != x && it.first != y && it.second == 3) { return it.first; } } } } } else if (v.size() == 7) { ask(v[0], v[1], v[2], v[3], v[4], x, y); v.erase(find(v.begin(), v.end(), x)); return solve(v); } else { vector aux; for (int i = 0; i < v.size(); i += 5) { if (i + 4 >= v.size()) { for (int k = i; k < v.size(); ++k) { aux.push_back(v[k]); } } else { ask(v[i], v[i + 1], v[i + 2], v[i + 3], v[i + 4], x, y); set S = {v[i], v[i + 1], v[i + 2], v[i + 3], v[i + 4]}; S.erase(x); S.erase(y); for (auto it: S) { aux.push_back(it); } } } return solve(aux); } } int main() { int T; assert(cin >> T); assert(1 <= T && T <= 1000); while (T--) { int N; assert(cin >> N); cnt = 0, limit = N / 2 + 4; assert(6 <= N && N <= 100); vector v(N); iota(v.begin(), v.end(), 1); int ans = solve(v); cout << "! " << ans << endl; } return 0; }