#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int w = 1, c = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') w = -1;
  for (; isdigit(ch); ch = getchar()) c = (c << 1) + (c << 3) + (ch ^ 48);
  return w * c;
}
const int M = 8888;
const long long lim = 1e18;
long long qry[50];
vector<int> v[50];
int ct;
bool p[M];
long long gt(long long x) {
  cout << "? " << x << endl;
  cin >> x;
  return x;
}
void solve() {
  long long ans = 1;
  int K = 1000000000;
  for (int i = (1); i <= (ct); ++i) {
    int o = gt(qry[i]), lst;
    for (int j = (0); j <= (((int)v[i].size() - 1)); ++j) {
      int pr = v[i][j];
      if (o % pr == 0) {
        long long now = 1;
        while (now * pr <= 1e9) now *= pr;
        int gg = gt(now);
        int ind = 0;
        while (gg % pr == 0) gg /= pr, ind++, K /= pr;
        ans *= ind + 1;
      }
      lst = v[i][j];
    }
    if (K < 1ll * lst * lst * lst) {
      cout << "! " << ans * 2 << "\n";
      return;
    }
  }
  ans = max(8ll, ans * 2);
  cout << "! " << ans << endl;
}
int main() {
  int N = pow(1e9 / 2 / 2, 0.3333334);
  long long now = 1;
  for (int i = (2); i <= (N); ++i) {
    if (!p[i]) {
      if (1.0 * now * i > lim) {
        qry[++ct] = now;
        v[ct + 1].push_back(i);
        now = i;
      } else {
        v[ct + 1].push_back(i);
        now *= i;
      }
    }
    for (int j = i * 2; j <= N; j += i) p[j] = 1;
  }
  qry[++ct] = now;
  int T = read();
  while (T--) solve();
  return 0;
}
