Problem: This is an interactive problem.

You are the head coach of a chess club. The club has 2n players, each player has some strength which can be represented by a number, and all those numbers are distinct. The strengths of the players are not known to you.

You need to select n players who would represent your club in the upcoming championship. Naturally, you want to select n players with the highest strengths.

You can organize matches between the players to do that. In every match, you pick two players, they play some games, and you learn which one of the two has higher strength. You can wait for the outcome of a match before deciding who will participate in the next one.

However, you do not want to know exactly how those n players compare between themselves, as that would make the championship itself less intriguing. More formally, you must reach a state where there is exactly one way to choose n players with the highest strengths that is consistent with the outcomes of the matches you organized, but there must be at least two possible orderings of those n players by strength that are consistent with the outcomes of the matches you organized.

Interaction

Your program has to process multiple test cases in one run. First, it should read the integer t (t ≥ 1) — the number of test cases. Then, it should process the test cases one by one.

In each test case, your program should start by reading the integer n (3 ≤ n ≤ 100) — the number of players to select out of 2n players. The sum of squares of the values of n over all test cases does not exceed 10 000.

Then your program can organize matches zero or more times. To organize a match, your program should print a match description formatted as ? i j — a question mark followed by two distinct numbers of players participating in the match. The players are numbered from 1 to 2n, inclusive. Remember to flush the output after printing the match description. Then your program should read the match outcome — it will be either the greater-than character (>), if the first player in the match description has higher strength, or the less-than character (<), if the second player in the match description has higher strength.

Your program can organize at most 4n^2 matches. After it is done organizing matches, it should print the exclamation mark (!) and continue to the next test case, or exit gracefully if this was the last test case. Remember to flush the output after printing the exclamation mark.

There must be exactly one way to choose n players with the highest strength that is consistent with the outcomes of the matches you organized, but there must be at least two possible orderings of those n players by their strength that are consistent with the outcomes of the matches you organized.

The judging program picks some distinct numbers as the strengths of all players before your program starts organizing matches and uses them to answer the requests.

Example

Input


2
3

&gt;

&lt;

&gt;

&lt;

&gt;

&gt;

3

&lt;

&lt;

&lt;

&gt;

&gt;


Output




? 1 3

? 4 2

? 4 5

? 6 5

? 3 4

? 5 6

!

? 3 4

? 4 2

? 5 3

? 6 4

? 3 1

!

Note

In the example, the players in the first test case are sorted by strength in decreasing order. From the matches in the example output, we can deduce that players 1, 2, and 3 have the highest strength, but we do not know how the player 1 compares to the player 2.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long inp, Inp;
long long i1, i2, i3, i4, i5, i6, i7, i8;
long long MOD = 998244353, MOD1 = (long long)1e9 + 7, MOD2 = (long long)1e9 + 9;
long long MOD3 = (long long)1e9 + 21;
double eps = 1e-9;
long long TMP =
    (chrono::high_resolution_clock::now().time_since_epoch().count() % MOD +
     MOD) %
    MOD;
auto STTMP = chrono::steady_clock::now();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  srand((unsigned int)TMP);
  long long T;
  cin >> T;
  for (long long t = (0); t < (T); t++) {
    long long N;
    cin >> N;
    vector<long long> win;
    map<pair<long long, long long>, long long> done;
    for (long long i = (0); i < (2 * N); i++) {
      win.push_back(i);
    }
    while (win.size() >= 4) {
      long long fpos, spos, finpos;
      char r;
      if (done.count({win.at(0), win.at(1)})) {
        if (done.at({win.at(0), win.at(1)}) == 0) {
          fpos = 1;
        } else {
          fpos = 0;
        }
      } else {
        cout << "? " << win.at(0) + 1 << " " << win.at(1) + 1 << endl;
        cin >> r;
        if (r == '>') {
          fpos = 1;
          done.insert({{win.at(0), win.at(1)}, 0});
          done.insert({{win.at(1), win.at(0)}, 1});
        } else {
          fpos = 0;
          done.insert({{win.at(0), win.at(1)}, 1});
          done.insert({{win.at(1), win.at(0)}, 0});
        }
      }
      if (done.count({win.at(2), win.at(3)})) {
        if (done.at({win.at(2), win.at(3)}) == 0) {
          spos = 3;
        } else {
          spos = 2;
        }
      } else {
        cout << "? " << win.at(2) + 1 << " " << win.at(3) + 1 << endl;
        cin >> r;
        if (r == '>') {
          spos = 3;
          done.insert({{win.at(2), win.at(3)}, 0});
          done.insert({{win.at(3), win.at(2)}, 1});
        } else {
          spos = 2;
          done.insert({{win.at(2), win.at(3)}, 1});
          done.insert({{win.at(3), win.at(2)}, 0});
        }
      }
      if (done.count({win.at(fpos), win.at(spos)})) {
        if (done.at({win.at(fpos), win.at(spos)}) == 0) {
          finpos = fpos;
        } else {
          finpos = spos;
        }
      } else {
        cout << "? " << win.at(fpos) + 1 << " " << win.at(spos) + 1 << endl;
        cin >> r;
        if (r == '>') {
          finpos = spos;
          done.insert({{win.at(fpos), win.at(spos)}, 0});
          done.insert({{win.at(spos), win.at(fpos)}, 1});
        } else {
          finpos = fpos;
          done.insert({{win.at(fpos), win.at(spos)}, 1});
          done.insert({{win.at(spos), win.at(fpos)}, 0});
        }
      }
      if (win.size() > 4) {
        win.at(finpos) = win.at(4);
        win.erase(win.begin() + 4);
      } else {
        win.erase(win.begin() + finpos);
      }
    }
    set<long long> dontt;
    for (auto it : win) {
      dontt.insert(it);
    }
    for (long long i = (0); i < (2 * N); i++) {
      for (long long j = (i + 1); j < (2 * N); j++) {
        if (i != j && !dontt.count(i) && !dontt.count(j) &&
            !done.count({i, j})) {
          cout << "? " << i + 1 << " " << j + 1 << endl;
          char r;
          cin >> r;
        }
      }
    }
    cout << "!" << endl;
  }
  return 0;
}