#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
const int M = 3e6 + 10;
const int inf = 2.11e9;
const int mo = 998244353;
long long p[N];
int v[N];
int tot;
long long q(long long x) {
  printf("? %lld\n", x);
  fflush(stdout);
  long long res;
  scanf("%lld", &res);
  return res;
}
void sol() {
  long long nw = 1, n = 1;
  for (auto i = (1); i <= (tot); ++i) v[i] = 0;
  for (auto o = (1); o <= (22); ++o) {
    long long x = nw;
    for (auto i = (1); i <= (tot); ++i)
      if (!v[i]) {
        if (1e18 / x < p[i]) break;
        x *= p[i];
        v[i] = 2;
      }
    long long res = q(x) / nw;
    for (auto i = (1); i <= (tot); ++i)
      if (v[i] == 2) {
        if (res % p[i]) {
          v[i] = 1;
          while (!(nw % p[i])) nw /= p[i];
        } else
          v[i] = 0, nw *= p[i], n *= p[i];
      }
  }
  long long ans = 1;
  for (auto i = (1); i <= (tot); ++i) {
    long long cnt = 1;
    for (; !(n % p[i]); n /= p[i]) ++cnt;
    ans *= cnt;
  }
  printf("! %lld\n", max(ans * 2, ans + 7));
  fflush(stdout);
}
int main() {
  for (auto i = (2); i <= (1000); ++i) {
    bool fl = 1;
    for (auto j = (1); j <= (tot); ++j)
      if (!(i % p[j])) {
        fl = 0;
        break;
      }
    if (fl) p[++tot] = i;
  }
  int t;
  scanf("%d", &t);
  for (auto i = (1); i <= (t); ++i) sol();
}
