#include <bits/stdc++.h>
using namespace std;
int n, m, cnt, a[100100], flag[100100], p[100100], cnt2[100100];
void xian() {
  for (int i = 2; i <= 10000; i++) {
    if (flag[i] == 0) p[++cnt] = i;
    for (int j = 1; j <= cnt && i * p[j] <= 10000; j++) {
      flag[i * p[j]] = 1;
      if (i % p[j] == 0) break;
    }
  }
}
struct doge {
  unsigned long long d, cnt, dd;
  bool operator<(const doge &x) const {
    if (cnt != x.cnt)
      return cnt < x.cnt;
    else
      return d > x.d;
  }
};
int main() {
  xian();
  int T;
  scanf("%d", &T);
  while (T--) {
    doge t;
    priority_queue<doge> pq;
    for (int i = 1; i <= cnt; i++) {
      t.d = p[i];
      t.cnt = 1;
      t.dd = p[i];
      a[i] = 0;
      pq.push(t);
    }
    unsigned long long u, v, cntv;
    for (int i = 1; i <= 22; i++) {
      u = 1;
      while (1) {
        t = pq.top();
        if (u > 1e18 / t.dd) break;
        pq.pop();
        u *= t.dd;
      }
      printf("? %llu\n", u);
      cout.flush();
      scanf("%llu", &u);
      for (int j = 1; j <= cnt; j++) {
        if (u % p[j] == 0) {
          v = 1;
          cntv = 0;
          while (u % p[j] == 0) {
            v *= p[j];
            cntv++;
            u /= p[j];
          }
          a[j] = cntv;
          t.d = p[j];
          t.cnt = cntv + 1;
          t.dd = v * p[j];
          pq.push(t);
        }
      }
    }
    int ans = 1;
    for (int i = 1; i <= cnt; i++) ans *= (a[i] + 1);
    ans *= 2;
    printf("! %d\n", ans);
  }
  return 0;
}
