#include <bits/stdc++.h>
using namespace std;
long long inf = 1e18;
long long pp = 1;
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return gcd(b, a % b);
}
long long get(long long x) {
  cout << "? " << x << endl;
  long long ans;
  cin >> ans;
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  while (t--) {
    vector<long long> pnow;
    vector<long long> p;
    vector<bool> stm;
    vector<long long> st;
    long long now = 1;
    long long cnt = 0;
    for (long long i = 2;; i++) {
      bool flag = 1;
      for (long long j = 2; j * j <= i; j++) {
        if (i % j == 0) {
          flag = 0;
          break;
        }
      }
      if (!flag) continue;
      if (cnt >= 18) {
        break;
      }
      if (inf / i > now) {
        pnow.push_back(i);
        now *= i;
        continue;
      }
      long long ansn = get(now);
      for (auto x : pnow) {
        if (ansn % x == 0) {
          p.push_back(x);
          stm.push_back(0);
          st.push_back(1);
        }
      }
      pnow.clear();
      now = 1;
      cnt++;
    }
    while (cnt < 22) {
      bool check = 1;
      for (long long i = 0; i < (long long)p.size(); i++) {
        if (!stm[i]) check = 0;
      }
      if (check) break;
      long long now = 1;
      auto stn = st;
      for (long long i = 0; i < (long long)p.size(); i++) {
        for (long long j = 0; j < st[i]; j++) now *= p[i];
      }
      long long pos = -1;
      while (1) {
        pos = (pos + 1) % (long long)p.size();
        if (stm[pos] == 1) continue;
        if (now > inf / p[pos]) break;
        now *= p[pos];
        stn[pos]++;
      }
      long long ansn = get(now);
      cnt++;
      for (long long i = 0; i < (long long)p.size(); i++) {
        if (stm[i] == 1) continue;
        long long z = p[i], cntz = 0;
        while (ansn % z == 0) {
          cntz++;
          z *= p[i];
        }
        st[i] = cntz;
        if (cntz < stn[i]) stm[i] = 1;
      }
    }
    long long ans = 1;
    for (long long i = 0; i < (long long)st.size(); i++) {
      ans *= (st[i] + 1);
    }
    cout << "! " << ans * 2 << endl;
  }
}
