#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int mod = 1000000007;
const long long linf = (long long)1e18;
int N = 1020;
long long lp[1000100], pr[1000100];
int cnt;
void sieve(int n) {
  for (int i = 2; i <= n; ++i) {
    if (lp[i] == 0) lp[i] = pr[cnt++] = i;
    for (int j = 0; j < cnt && pr[j] <= lp[i] && i * pr[j] <= n; ++j)
      lp[i * pr[j]] = pr[j];
  }
}
long long query(long long x) {
  cout << "? " << x << endl;
  long long gcd;
  cin >> gcd;
  return gcd;
}
void solve() {
  long long c = (long long)1e9 / 4;
  vector<long long> cur, pq;
  long long prod = 1;
  for (int i = 0; i < cnt; i++) {
    if (c < pr[i] * pr[i] * pr[i]) break;
    if (linf / pr[i] < prod) {
      long long g = query(prod);
      while (!cur.empty()) {
        if (g % cur.back() == 0) {
          pq.push_back(cur.back());
          if ((int)pq.size() <= 2) c *= 2;
          c /= cur.back();
        }
        cur.pop_back();
      }
      prod = 1;
    }
    prod *= pr[i];
    cur.push_back(pr[i]);
  }
  if (!cur.empty()) {
    long long g = query(prod);
    while (!cur.empty()) {
      if (g % cur.back() == 0) {
        pq.push_back(cur.back());
      }
      cur.pop_back();
    }
  }
  sort(pq.begin(), pq.end());
  if ((int)pq.size() % 2) {
    for (int i = 0; i < cnt; i++) {
      if (pq[i] != pr[i]) {
        pq.push_back(pr[i]);
        break;
      }
    }
  }
  long long ans = 2;
  for (int i = 0; i < (int)pq.size(); i += 2) {
    long long p = pq[i], q = pq[i + 1];
    long long x = 1, y = 1;
    while (x * p <= (long long)1e9) x *= p;
    while (y * q <= (long long)1e9) y *= q;
    long long g = query(x * y);
    int u = 1, v = 1;
    while (g % p == 0) {
      u++;
      g /= p;
    }
    while (g % q == 0) {
      v++;
      g /= q;
    }
    ans *= u * v;
  }
  cout << "! " << max(8ll, ans) << endl;
}
int main() {
  sieve(1020);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
