#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << "\n";
  err(++it, args...);
}
const double PI = acos(-1);
const double eps = (1e-9);
const long long int inf = 1e18;
const int M = (1e9);
const int N = (1e6) + 3;
int isprime[N];
void sieve() {
  int i, a;
  fill(isprime + 2, isprime + N, 1);
  for (i = 2; i * i < N; i++) {
    if (isprime[i])
      for (a = i * i; a < N; a += i) isprime[a] = 0;
  }
  return;
}
long long int query(long long int val) {
  cout << "? " << val << "\n";
  fflush(stdout);
  cin >> val;
  return val;
}
void result(int val) {
  cout << "! " << val << "\n";
  fflush(stdout);
}
vector<int> prime;
void check(long long int val) {
  int i;
  for (i = 2; i < 700; ++i)
    if (isprime[i] && val % i == 0) prime.emplace_back(i);
  return;
}
void initial() {
  int q = 17;
  int i = 2;
  while (q--) {
    long long int p = 1;
    while (1) {
      while (!isprime[i]) i++;
      if (p > (inf / i)) break;
      p *= i, i++;
    }
    check(query(p));
  }
  return;
}
long long int max_val(long long int p) {
  if (p == 1) return 1;
  long long int temp = 1;
  while (temp * p < M) temp *= p;
  return temp;
}
int divisor(long long int temp, int p) {
  if (p == 1) return 1;
  int x = 0;
  while (temp % p == 0) x++, temp /= p;
  return x + 1;
}
void solve() {
  int i, n;
  prime.clear();
  initial();
  n = (int)prime.size();
  int ans = 1;
  long long int total = 1;
  int p1, p2;
  for (i = 0; i < n; i += 2) {
    p1 = prime[i], p2 = 1;
    if (i + 1 < n) p2 = prime[i + 1];
    long long int temp =
        query(((long long int)(max_val(p1)) * (long long int)(max_val(p2))));
    total *= temp;
    ans *= divisor(temp, p1);
    ans *= divisor(temp, p2);
  }
  if (total < 4)
    ans *= 9, ans /= 2, result(ans);
  else
    result(2 * ans);
}
int main() {
  int t = 1;
  scanf("%d", &t);
  sieve();
  while (t--) solve();
}
