#include <bits/stdc++.h>
using namespace std;
long long read() {
  fflush(stdout);
  long long x;
  scanf("%lld", &x);
  return x;
}
long long ans, TT, mp[50005];
void work(long long x, long long n) {
  for (long long i = 2; i <= n; i++) {
    if (mp[i]) continue;
    long long anss = 0;
    if (x % i == 0) {
      long long now = 1;
      while (now < 1e18 / i) now *= i;
      printf("? %lld\n", now);
      TT++;
      long long xx = read();
      while (xx % i == 0) anss++, xx /= i;
    }
    ans *= (anss + 1);
    if (TT >= 22) return;
  }
}
signed main() {
  for (long long i = 2; i <= 10000; i++) {
    for (long long j = 2; j * j <= i; j++) {
      if (i % j == 0) mp[i] = 1;
    }
  }
  long long T = read();
  while (T--) {
    ans = 1;
    TT = 0;
    long long now = 1;
    for (long long i = 2; i <= 2000; i++) {
      if (!mp[i]) {
        if (now >= 1e18 / i) {
          printf("? %lld\n", now);
          long long x = read();
          TT++;
          if (TT == 22) break;
          if (x != 1) work(x, i);
          now = 1;
        }
        now *= i;
      }
      if (TT == 22) break;
    }
    printf("! %lld\n", max(ans * 2, ans + 7));
  }
  return 0;
}
