#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;
const int mod = 1e9 + 7;
const ll inf = 1e9;
const ll INF = 1e18;
const ld EPS = 1e-7;
const int N = 1e6 + 66;
vector<ll> pr;
ll asked_times = 0;
ll ask(ll x) {
  cout << "? " << x << endl;
  cout.flush();
  ll y = 1;
  cin >> y;
  asked_times++;
  cout.flush();
  return y;
}
void solve() {
  asked_times = 0;
  vector<ll> vec;
  ll cur = 1;
  for (ll p : pr) {
    if (cur > INF / p) {
      vec.push_back(cur);
      cur = 1;
    }
    cur *= p;
  }
  if (cur > 1) {
    vec.push_back(cur);
  }
  vector<ll> P;
  for (ll now : vec) {
    ll x = ask(now);
    for (ll j = 2; j * j <= x; ++j) {
      if (x % j == 0) {
        P.push_back(j);
        while (x % j == 0) {
          x /= j;
        }
      }
    }
    if (x > 1) {
      P.push_back(x);
    }
  }
  if ((int)P.size() & 1) {
    P.push_back(pr.back());
  }
  ll ans = 1;
  for (int j = 0; j < (int)P.size(); j += 2) {
    ll p1 = P[j], p2 = P[j + 1];
    ll x = 1, y = 1;
    while (x * p1 <= inf) x *= p1;
    while (y * p2 <= inf) y *= p2;
    ll z = ask(x * y);
    ll t1 = 1, t2 = 1;
    while (z % p1 == 0) z /= p1, t1++;
    while (z % p2 == 0) z /= p2, t2++;
    ans *= t1 * t2;
  }
  cout << "! " << max(8ll, ans * 2) << endl;
  cout.flush();
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  for (int i = 2; i <= 679; ++i) {
    bool ok = 1;
    for (int j = 2; j < i; ++j) {
      if (i % j == 0) {
        ok = 0;
        break;
      }
    }
    if (ok) pr.push_back(i);
  }
  int tt = 1;
  cin >> tt;
  while (tt--) {
    solve();
    assert(asked_times <= 22);
    cout << "\n";
  }
}
