#include <bits/stdc++.h>
using namespace std;
int pri[101000], pcnt;
bool depri[101000];
inline void init() {
  const int up = 40000;
  for (int i = 2; i <= up; ++i) {
    if (!depri[i]) pri[++pcnt] = i;
    for (int j = 1; j <= pcnt && pri[j] * i <= up; ++j) {
      depri[i * pri[j]] = true;
      if (i % pri[j] == 0) break;
    }
  }
}
int ans;
int ct = 0;
int mi[222], mtot;
inline void End() { cout << "! " << ans * 2 << endl; }
inline int Get_mi(int p) {
  int res = 1;
  mi[mtot = 0] = 1;
  while (1ll * res * p <= 1000000000) res *= p, mi[++mtot] = res;
  return res;
}
inline void Get_pri(long long d) {
  for (int i = 2; i * i <= d; ++i) {
    if (d % i == 0) {
      ++ct;
      if (ct > 22) return End(), void();
      int gaomi = Get_mi(i);
      cout << "? " << gaomi << endl;
      int g;
      cin >> g;
      for (int j = 0; j <= mtot; ++j)
        if (mi[j] == g) {
          ans = ans * (j + 1);
          break;
        }
      d /= i;
    }
  }
  if (d != 1) {
    ++ct;
    if (ct > 22) return End(), void();
    int gaomi = Get_mi(d);
    cout << "? " << gaomi << endl;
    int g;
    cin >> g;
    for (int j = 0; j <= mtot; ++j)
      if (mi[j] == g) {
        ans = ans * (j + 1);
        break;
      }
  }
}
inline void work() {
  long long nw = 1;
  for (int i = 1; i <= pcnt; ++i) {
    if (1.0 * nw * pri[i] > 1e18) {
      ++ct;
      if (ct > 22) return End(), void();
      cout << "? " << nw << endl;
      long long g;
      cin >> g;
      if (g != 1) {
        Get_pri(g);
        if (ct > 22) return;
      }
      nw = pri[i];
    } else {
      nw *= pri[i];
    }
  }
}
int main() {
  init();
  int _;
  cin >> _;
  while (_--) {
    ct = 0;
    ans = 1;
    work();
  }
  return 0;
}
