#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 5, MXX = 23;
const long long mod = 1e9 + 7, inf = 1e18 + 6;
long long cnt(long long x, long long y) {
  return x < y ? 1 : y * cnt(x / y, y);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(9);
  vector<long long> pr;
  bitset<10000> mrk;
  for (int i = 2; i < 10000; ++i)
    if (!mrk[i]) {
      for (int j = 2 * i; j < 10000; j += i) mrk[j] = 1;
      pr.push_back(i);
    }
  int T;
  cin >> T;
  while (T--) {
    long long ch = 0, x = 1e9, fc = 1;
    vector<long long> get, ask;
    vector<pair<long long, long long> > fix;
    for (int stre = 0; stre < 22; ++stre) {
      long long q = 1;
      int pn = 0;
      for (auto y : get)
        if (double(q) * cnt(x, y) * y <= 1e18) q *= cnt(x, y) * y, pn++;
      while (double(q) * pr[ch] <= 1e18)
        q *= pr[ch], ask.push_back(pr[ch]), ch++;
      cout << "? " << q << endl;
      long long ans;
      cin >> ans;
      for (int i = 0; i < pn; ++i) {
        fix.push_back(make_pair(get[i], 0));
        while (ans % get[i] == 0) {
          fc *= get[i];
          ans /= get[i];
          x /= get[i];
          fix.back().second++;
        }
      }
      get.erase(get.begin(), get.begin() + pn);
      for (auto y : ask)
        if (ans % y == 0) get.push_back(y), x /= y;
      ask.clear();
    }
    int nw = 1;
    for (auto y : fix) nw *= y.second + 1;
    if (nw == 1)
      cout << "! 8" << endl;
    else
      cout << "! " << 2 * nw << endl;
  }
  return 0;
}
