#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000001;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long pwr(long long a, long long b) {
  if (b == 0) return 1;
  if (b & 1) {
    long long aux = pwr(a, (b ^ 1));
    if (a * aux > INF)
      return INF;
    else
      return a * aux;
  }
  long long aux = pwr(a, (b >> 1));
  if (aux * aux > INF)
    return INF;
  else
    return aux * aux;
}
long long flog(long long val, long long b) {
  int l = 0, r = 64;
  while (l < r) {
    int mid = ((l + r + 1) >> 1);
    if (pwr(b, mid) > val)
      r = mid - 1;
    else
      l = mid;
  }
  return l;
}
bool fprime(long long val) {
  for (long long i = 2; i * i <= val; i++)
    if (val % i == 0) return false;
  return true;
}
int cntd(long long val) {
  int ans = 0;
  for (long long i = 1; i * i <= val; i++)
    if (val % i == 0) {
      ans++;
      if (i * i != val) ans++;
    }
  return ans;
}
int t;
long long ask(long long val) {
  cout << "? " << val << "\n";
  cout << flush;
  long long ans;
  cin >> ans;
  return ans;
}
vector<long long> vp;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> t;
  while (t--) {
    long long x = 1;
    long long lim = 1000000000;
    long long q = 1;
    vp.clear();
    int cnt = 0;
    int last = 0;
    for (long long p = 2; cnt < 22; p++)
      if (fprime(p) == true) {
        if (1000000000000000000 / q < p) {
          long long g = ask(q);
          cnt++;
          long long q1 = 1;
          for (long long k : vp)
            if (gcd(k, g) != 1 && cnt < 22) {
              long long e = flog(lim / x, k);
              long long pw = pwr(k, e);
              if (1000000000000000000 / q1 < pw) {
                cnt++;
                x = lcm(x, ask(q1));
                q1 = pw;
              } else
                q1 *= pw;
            }
          if (cnt < 22 && q1 > 1) {
            x = lcm(x, ask(q1));
            cnt++;
          }
          vp.clear();
          q = p;
          vp.push_back(p);
        } else {
          q *= p;
          last = p;
          vp.push_back(p);
        }
      }
    if (cnt < 22) {
      long long g = ask(q);
      cnt++;
      long long q1 = 1;
      for (long long k : vp)
        if (gcd(k, g) != 1 && cnt < 22) {
          long long e = flog(lim / x, k);
          long long pw = pwr(k, e);
          if (1000000000000000000 / q1 < pw) {
            cnt++;
            x = lcm(x, ask(q1));
            q1 = pw;
          } else
            q1 *= pw;
        }
      if (cnt < 22 && q1 > 1) x = lcm(x, ask(q1));
    }
    cout << "! " << cntd(x) * 2 << "\n";
    cout << flush;
  }
  return 0;
}
