#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
vector<ll> primes = {
    2,   3,   5,   7,   11,  13,  17,  19,  23,  29,  31,  37,  41,  43,
    47,  53,  59,  61,  67,  71,  73,  79,  83,  89,  97,  101, 103, 107,
    109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181,
    191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263,
    269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349,
    353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433,
    439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521,
    523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613,
    617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701,
    709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809,
    811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887,
    907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997};
const ll XMAX = 1e9;
const ll QMAX = XMAX * XMAX;
const ll MAX_QUERIES = 22;
int i = 0;
int queries = 0;
ll query(ll Q) {
  queries++;
  cout << "? " << Q << endl;
  ll g;
  cin >> g;
  return g;
}
vector<ll> find_factors() {
  if (queries == MAX_QUERIES) return {};
  ll Q = 1;
  int j = i;
  for (; j < (int)primes.size() && Q <= QMAX / primes[j]; j++) Q *= primes[j];
  ll g = query(Q);
  vector<ll> ans;
  for (int k = i; k < j; k++)
    if (g % primes[k] == 0) ans.push_back(primes[k]);
  i = j;
  return ans;
}
ll max_power(ll p) {
  ll ans = 1;
  while (ans <= XMAX / p) ans *= p;
  return ans;
}
ll count_power(ll n, ll p) {
  ll ans = 0;
  for (; n % p == 0; n /= p) ans++;
  return ans;
}
ll count_divisors(vector<ll>& factors) {
  if (factors.empty()) return 1;
  ll ans = 1;
  for (int k = 0; k < (int)factors.size() && queries < MAX_QUERIES; k += 2) {
    ll Q = max_power(factors[k]);
    if (k + 1 < (int)factors.size()) Q *= max_power(factors[k + 1]);
    ll g = query(Q);
    ans *= 1 + count_power(g, factors[k]);
    if (k + 1 < (int)factors.size()) ans *= 1 + count_power(g, factors[k + 1]);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << setprecision(12);
  cin.tie(nullptr);
  int T;
  cin >> T;
  while (T--) {
    i = 0;
    queries = 0;
    ll divisors = 1;
    while (i < (int)primes.size() && queries < MAX_QUERIES) {
      vector<ll> factors = find_factors();
      divisors *= count_divisors(factors);
    }
    cout << "! " << max(divisors * 2, divisors + 7) << endl;
  }
}
