Problem: Linda likes to change her hair color from time to time, and would be pleased if her boyfriend Archie would notice the difference between the previous and the new color. Archie always comments on Linda's hair color if and only if he notices a difference — so Linda always knows whether Archie has spotted the difference or not.

There is a new hair dye series in the market where all available colors are numbered by integers from 1 to N such that a smaller difference of the numerical values also means less visual difference.

Linda assumes that for these series there should be some critical color difference C (1 ≤ C ≤ N) for which Archie will notice color difference between the current color color_{new} and the previous color color_{prev} if \left|color_{new} - color_{prev}\right| ≥ C and will not if \left|color_{new} - color_{prev}\right| < C.

Now she has bought N sets of hair dye from the new series — one for each of the colors from 1 to N, and is ready to set up an experiment. Linda will change her hair color on a regular basis and will observe Archie's reaction — whether he will notice the color change or not. Since for the proper dye each set should be used completely, each hair color can be obtained no more than once.

Before the experiment, Linda was using a dye from a different series which is not compatible with the new one, so for the clearness of the experiment Archie's reaction to the first used color is meaningless.

Her aim is to find the precise value of C in a limited number of dyes. Write a program which finds the value of C by experimenting with the given N colors and observing Archie's reactions to color changes.

Interaction

This is an interactive task. In the beginning you are given a single integer T (1 ≤ T ≤ 100), the number of cases in the test.

For each test case, the input first contains a single integer — the value of N (1 < N ≤ 10^{18}). The value of C is kept secret by the grading system.

Then your program should make queries writing output in the following format: "? P", where P is an integer (1 ≤ P ≤ N) denoting the next color used. For each query the grading system gives an answer in the next line of the input. The answer is 1 if Archie notices the color difference between the last two colors and 0 otherwise. No two queries should have the same P value.

When your program determines C, it should output its value in the following format: "= C". The grading system will not respond to this output and will proceed with the next test case.

Your program may use at most 64 queries "?" for each test case to find the correct value of C.

To establish proper communication between your program and the grading system, you should flush the output stream after each query.

$$$\begin{array}{ll} Language & Command \\\ \hline C++ & std::cout << std::endl; \\\ Java & System.out.flush(); \\\ Python & sys.stdout.flush() \end{array}$$$ Flush commands 

Note that std::endl writes a newline and flushes the stream.

It is possible to receive an "Output isn't correct" outcome even after printing a correct answer, if task constraints were violated during the communication. Violating the communication protocol itself may result in an "Execution killed" outcome.

Submitting user tests requires specifying an input file with the testcase parameters. The format of the input file is "T" in the first line, and then "N C" on a single line for each of the T cases.

Scoring

Subtasks: 

  1. (9 points) N ≤ 64 
  2. (13 points) N ≤ 125 
  3. (21 points) N ≤ 1000 
  4. (24 points) N ≤ 10^9 
  5. (33 points) No further constraints. 

Example

Input


1

7

1

1

0

0

1


Output



? 2

? 7

? 4

? 1

? 5

= 4

Note

Comments to the example input line by line: 

  1. N = 7. 
  2. Answer to the first query is meaningless (can also be 0). 
  3. C ≤ 5. 
  4. 3 < C ≤ 5. It would be wise to check difference 4. However, this can not be done in the next query since 4 + 4 = 8 and 4 - 4 = 0 both are outside the allowed interval 1 ≤ P ≤ 7. 
  5. 3 < C ≤ 5. 
  6. 3 < C ≤ 4. Therefore, C = 4. 

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int T;
  cin >> T;
  while (T--) {
    long long int n;
    cin >> n;
    if (n <= 64) {
      int mn = 1;
      int mx = n;
      bool did = false;
      for (int i = 1; i <= n; i++) {
        int x;
        if (i % 2) {
          cout << "? " << mn << "\n" << endl;
          mn++;
        } else {
          cout << "? " << mx << "\n" << endl;
          mx--;
        }
        cin >> x;
        int diff = mx - mn + 2;
        if (i != 1 && x == 0) {
          cout << "= " << diff + 1 << endl;
          did = true;
          break;
        }
      }
      if (!did) {
        cout << "= 1" << endl;
      }
      continue;
    }
    long long int l = 1;
    long long int r = n;
    long long int testl = 1;
    long long int testr = n;
    long long int moved = 0;
    long long int minval = 0;
    long long int maxval = 0;
    bool toadd = true;
    while (testl < testr) {
      long long int mid = (testl + testr) / 2;
      if (toadd) {
        moved += mid;
        maxval = max(maxval, moved);
      } else {
        moved -= mid;
        minval = min(minval, moved);
      }
      toadd = !toadd;
      testl = mid + 1;
    }
    long long int prev = n - maxval;
    cout << "? " << prev << "\n" << endl;
    if (prev + minval < 1) {
      return -1;
    }
    int x;
    cin >> x;
    set<long long int> was;
    was.insert(prev);
    bool diddd = false;
    toadd = true;
    while (l < r) {
      if (r - l <= 63LL - was.size()) {
        long long int canfrom = -1;
        vector<long long int> checkstart;
        checkstart.push_back(1);
        if (n - r >= 1) {
          checkstart.push_back(n - r);
        }
        for (long long int el : was) {
          if (el + r <= n) {
            checkstart.push_back(el + 1);
          }
          if (el - r >= 1) {
            checkstart.push_back(el - r);
          }
        }
        for (long long int start : checkstart) {
          long long int mn = start;
          long long int mx = start + r - 1;
          bool good = true;
          for (long long int i = 1; i <= r - l + 1; i++) {
            if (i % 2) {
              if (was.count(mn)) {
                good = false;
                break;
              }
              mn++;
            } else {
              if (was.count(mx)) {
                good = false;
                break;
              }
              mx--;
            }
          }
          if (good) {
            canfrom = start;
            break;
          }
        }
        if (canfrom != -1) {
          diddd = true;
          long long int mn = canfrom;
          long long int mx = canfrom + r - 1;
          bool did = false;
          for (long long int i = 1; i <= r - l + 1; i++) {
            if (i % 2) {
              if (was.count(mn) || mn < 1 || mn > n) {
              }
              cout << "? " << mn << "\n" << endl;
              was.insert(mn);
              mn++;
            } else {
              if (was.count(mx) || mx < 1 || mx > n) {
              }
              cout << "? " << mx << "\n" << endl;
              was.insert(mx);
              mx--;
            }
            cin >> x;
            long long int diff = mx - mn + 2;
            if (i != 1 && x == 0) {
              l = r = diff + 1;
              did = true;
              break;
            }
          }
          if (!did) {
            r = l;
          }
          break;
        }
      }
      if (r - l <= 5 && r < n - 10) {
        while (true) {
        }
      }
      long long int mid = (l + r) / 2;
      if (toadd) {
        if (prev + mid <= n && !was.count(prev + mid)) {
          cout << "? " << prev + mid << endl;
          was.insert(prev + mid);
          prev += mid;
        } else if (prev - mid >= 1 && !was.count(prev - mid)) {
          cout << "? " << prev - mid << endl;
          was.insert(prev - mid);
          prev -= mid;
        } else {
          mid--;
          if (prev + mid <= n && !was.count(prev + mid)) {
            cout << "? " << prev + mid << endl;
            was.insert(prev + mid);
            prev += mid;
          } else if (prev - mid >= 1 && !was.count(prev - mid)) {
            cout << "? " << prev - mid << endl;
            was.insert(prev - mid);
            prev -= mid;
          } else {
            mid += 2;
            if (prev + mid <= n && !was.count(prev + mid)) {
              cout << "? " << prev + mid << endl;
              was.insert(prev + mid);
              prev += mid;
            } else {
              if (prev - mid < 1 || was.count(prev - mid)) {
                return -1;
              }
              cout << "? " << prev - mid << endl;
              was.insert(prev - mid);
              prev -= mid;
            }
          }
        }
      } else {
        if (prev - mid >= 1 && !was.count(prev - mid)) {
          cout << "? " << prev - mid << "\n" << endl;
          was.insert(prev - mid);
          prev -= mid;
        } else if (prev + mid <= n && !was.count(prev + mid)) {
          cout << "? " << prev + mid << "\n" << endl;
          was.insert(prev + mid);
          prev += mid;
        } else {
          mid--;
          if (prev - mid >= 1 && !was.count(prev - mid)) {
            cout << "? " << prev - mid << "\n" << endl;
            was.insert(prev - mid);
            prev -= mid;
          } else if (prev + mid <= n && !was.count(prev + mid)) {
            cout << "? " << prev + mid << "\n" << endl;
            was.insert(prev + mid);
            prev += mid;
          } else {
            mid += 2;
            if (prev - mid >= 1 && !was.count(prev - mid)) {
              cout << "? " << prev - mid << "\n" << endl;
              was.insert(prev - mid);
              prev -= mid;
            } else {
              if (was.count(prev + mid) || prev + mid > n) {
                while (prev - mid < 1 || was.count(prev - mid)) {
                  mid--;
                }
                cout << "? " << prev - mid << "\n" << endl;
                was.insert(prev - mid);
                prev -= mid;
              } else {
                cout << "? " << prev + mid << "\n" << endl;
                was.insert(prev + mid);
                prev += mid;
              }
            }
          }
        }
      }
      toadd = !toadd;
      cin >> x;
      if (x == 0) {
        l = mid + 1;
      } else {
        r = mid;
      }
    }
    if (l < r) {
      while (true) {
      }
    }
    cout << "= " << l << endl;
  }
  return 0;
}