#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 5;
const long long M = 1e6 + 5;
const long long mod = 1e9 + 7;
const long long m1 = 1e9 + 7;
const long long m2 = 1e9 + 9;
const long long p1 = 402653189;
const long long p2 = 1610612741;
const long long LN = 61;
long long powermodm(long long x, long long n, long long M) {
  long long result = 1;
  while (n > 0) {
    if (n % 2 == 1) result = (result * x) % M;
    x = (x * x) % M;
    n = n / 2;
  }
  return result;
}
long long power(long long _a, long long _b) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a);
    _b /= 2;
    _a = (_a * _a);
  }
  return _r;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) {
  return (max(a, b) / gcd(a, b)) * min(a, b);
}
long long dx[4] = {-1, 1, 0, 0};
long long dy[4] = {0, 0, 1, -1};
const long long MAX = sqrt(1e9);
const long long INFL = 1e18;
vector<long long> pri, max_vals;
bool p[N];
void pre() {
  for (long long i = 2; i < N; i++) p[i] = true;
  for (long long i = 2; i <= MAX; i++) {
    if (p[i]) {
      pri.push_back(i);
      for (long long j = i * i; j <= MAX; j += i) p[j] = false;
    }
  }
  for (auto it : pri) {
    long long curr = it;
    while (curr * it <= 1e9) curr *= it;
    max_vals.push_back(curr);
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  pre();
  long long i, j;
  long long t;
  cin >> t;
  while (t--) {
    long long curr = 1, ans = 1, que = 0;
    for (i = 0; i < pri.size(); i++) {
      long long right = pri.size(), mul = 1;
      for (j = i; j < pri.size(); j++) {
        if (mul > (INFL / pri[j])) {
          right = j;
          break;
        }
        mul *= pri[j];
      }
      if (que == 22) break;
      que++;
      cout << "? " << mul << "\n";
      cout.flush();
      long long val;
      cin >> val;
      for (j = i; j < right; j++) {
        if (val % pri[j] == 0) {
          if (que >= 22) break;
          que++;
          cout << "? " << max_vals[j] << "\n";
          cout.flush();
          long long val1;
          cin >> val1;
          curr *= val1;
          long long cnt = 0;
          while (val1) {
            cnt++;
            val1 /= pri[j];
          }
          ans *= cnt;
        }
      }
      i = right - 1;
    }
    cout << "! " << max(ans + 7, 2 * ans) << "\n";
    cout.flush();
  }
  return 0;
}
