#include <bits/stdc++.h>
using namespace std;
int T, n, cnt = 0;
int vis[1000010], prim[1000010];
const long long inf = 1e18;
const long long lim = 1e9;
void setup() {
  for (register int i = 2; i <= 630; i++) {
    if (!vis[i]) prim[++cnt] = i;
    for (register int j = 1; j <= cnt && i * prim[j] <= 630; j++) {
      vis[i * prim[j]] = 1;
      if (i % prim[j] == 0) break;
    }
  }
}
int main() {
  setup();
  scanf("%d", &T);
  fflush(stdin);
  while (T--) {
    long long res = 1, pw = 1, ans = 1;
    bool flag = 0;
    for (register int l = 1, r = 1; l <= cnt && r <= cnt; l = r, res = 1) {
      while (r <= cnt && inf / res >= prim[r]) {
        res *= prim[r];
        r++;
      }
      printf("? %lld\n", res);
      fflush(stdout);
      scanf("%lld", &res);
      fflush(stdin);
      for (register int i = l; i < r; i++) {
        if (res % prim[i]) continue;
        long long tmp = 1;
        while (tmp * prim[i] <= lim) tmp *= prim[i];
        printf("? %lld\n", tmp);
        fflush(stdout);
        scanf("%lld", &tmp);
        fflush(stdin);
        pw *= tmp;
        int tot = 0;
        while (tmp) {
          tot++;
          tmp /= prim[i];
        }
        ans *= tot;
      }
      if (ceil(pow(ceil(1.0 * lim / pw), 1.0 / 3)) <= prim[r - 1]) {
        printf("! %d\n", 2 * ans);
        fflush(stdout);
        flag = 1;
        break;
      }
    }
    if (flag) continue;
    if (pw == 1) {
      printf("! 8\n");
      fflush(stdout);
    } else {
      printf("! 9\n");
      fflush(stdout);
    }
  }
  return 0;
}
