#include <bits/stdc++.h>
using namespace std;
vector<string> vec_splitter(string s) {
  for (char& c : s) c = c == ',' ? ' ' : c;
  stringstream ss;
  ss << s;
  vector<string> res;
  for (string z; ss >> z; res.push_back(z))
    ;
  return res;
}
void debug_out(vector<string> args, int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
  if (idx > 0) cerr << ", ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, T...);
}
void localTest() {}
const long long N = 1e5 + 5, MX = 1e9, M = 1e18;
vector<long long> primes;
long long vis[N], cnt;
void seive() {
  for (long long i = 2; i * i <= MX; ++i) {
    if (!vis[i]) {
      primes.push_back(i);
      for (long long j = i * i; j * j <= MX; j += i) vis[j] = 1;
    }
  }
}
long long query(long long p) {
  long long lo = 1, hi = 0, mxp = p, ret = 1, gcd = 1;
  while (mxp <= MX) mxp *= p, hi++;
  if (cnt >= 22) return ret;
  ++cnt;
  cout << "? " << mxp << endl;
  cout.flush();
  cin >> gcd;
  cout.flush();
  long long po = 0;
  while (gcd % p == 0) po++, gcd /= p;
  return po;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  seive();
  long long t;
  cin >> t;
  while (t--) {
    long long ans = 1, idx = 0, n = primes.size();
    cnt = 0;
    while (cnt < 22) {
      long long mul = 1, pidx = idx, gcd = 1;
      for (long long i = idx; i <= n - 1; ++i) {
        if (mul > M / primes[i]) {
          idx = i;
          break;
        }
        mul *= primes[i];
      }
      ++cnt;
      cout << "? " << mul << endl;
      cout.flush();
      cin >> gcd;
      cout.flush();
      for (long long i = pidx; i <= idx - 1; ++i) {
        if (gcd % primes[i] == 0) {
          long long val = query(primes[i]);
          ans *= (val + 1);
        }
      }
    }
    cout << "! " << max(2 * ans, ans + 7) << endl;
    cout.flush();
  }
  return 0;
}
