#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
const long long Maxv = 1e18;
const long long M = 1e9;
int primes[N], tot;
int check[N];
int store[N], idx;
void init(int n) {
  for (int i = 2; i <= n; i++) {
    if (!check[i]) {
      primes[++tot] = i;
    }
    for (int j = 1; primes[j] * i <= n; j++) {
      check[i * primes[j]] = true;
      if (i % primes[j] == 0) break;
    }
  }
}
void query(long long x) {
  cout << "? " << x << endl;
  cout.flush();
  long long t;
  cin >> t;
  for (int i = 2; i <= t; i++) {
    if (t % i == 0) {
      while (t % i == 0) {
        t /= i;
      }
      store[++idx] = i;
    }
  }
  if (t > 1) store[++idx] = t;
}
long long op(long long x) {
  cout << "? " << x << endl;
  cout.flush();
  long long t;
  cin >> t;
  return t;
}
long long calc(long long x) {
  long long ans = 1;
  for (int i = 2; i <= x; i++) {
    if (x % i == 0) {
      int cnt = 0;
      while (x % i == 0) x /= i, cnt++;
      ans *= (cnt + 1);
    }
  }
  if (x > 1) ans *= 2;
  return ans;
}
int main() {
  int T;
  cin >> T;
  init(630);
  while (T--) {
    long long mul = 1;
    idx = 0;
    for (int i = 1; i <= tot; i++) {
      if (mul < Maxv / primes[i]) {
        mul *= primes[i];
      } else {
        query(mul);
        mul = primes[i];
      }
    }
    if (mul != 1) query(mul);
    long long ans = 1;
    for (int i = 1; i <= idx; i++) {
      long long p1 = 1, p2 = 1;
      while (p1 * store[i] < M) p1 *= store[i];
      i++;
      while (i <= idx && p2 * store[i] < M) p2 *= store[i];
      ans *= op(p1 * p2);
    }
    if (ans >= 4)
      cout << "! " << (calc(ans) << 1ll) << endl;
    else
      cout << "! " << 8 << endl;
  }
}
