#include <bits/stdc++.h>
using namespace std;
const long long N = 630;
const long long L9 = 1e9;
const long long L18 = 1e18;
long long p[N];
vector<long long> pr;
void init() {
  fill(p, p + N, 1);
  for (long long i = 2; i < N; i++) {
    for (long long j = 2 * i; j < N; j += i) {
      p[j] = 0;
    }
    if (p[i]) pr.push_back(i);
  }
}
long long query(long long x) {
  cout << "? " << x << endl;
  long long res;
  cin >> res;
  return res;
}
long long f(long long x) {
  long long c = x;
  while (c * x <= L9) c *= x;
  return c;
}
void solve() {
  long long cmul = 1;
  vector<long long> cp;
  vector<long long> primes_in;
  auto print = [&]() {
    long long res = query(cmul);
    for (auto t : cp) {
      if (res % t == 0) {
        primes_in.push_back(t);
      }
    }
    cp.clear();
    cmul = 1;
  };
  auto apply = [&](long long f) {
    if (cmul > L18 / f) {
      print();
    }
    cmul *= f;
    cp.push_back(f);
  };
  for (auto t : pr) {
    apply(t);
  }
  print();
  long long c = 1;
  long long x = 1;
  for (long long i = 0; i < (long long)primes_in.size();) {
    vector<long long> cur_query;
    long long num = 1;
    for (long long j = i; j < i + 2 && j < (long long)primes_in.size(); j++) {
      cur_query.push_back(primes_in[j]);
      num *= f(primes_in[j]);
    }
    long long res = query(num);
    x *= res;
    for (auto t : cur_query) {
      long long cnt = 0;
      while (res % t == 0) {
        cnt++;
        res /= t;
      }
      c *= (cnt + 1);
    }
    i += cur_query.size();
  }
  if (x <= 3) {
    if (c <= 1) {
      cout << "! " << 5 << endl;
    } else {
      cout << "! " << 9 << endl;
    }
  } else {
    cout << "! " << 2 * c << endl;
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  init();
  long long q;
  cin >> q;
  while (q--) {
    solve();
  }
}
