#include <bits/stdc++.h>
using namespace std;
const int seed = 131;
const long long LLMAX = 2e18;
const int MOD = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 1e4 + 10;
const int hmod1 = 0x48E2DCE7;
const int hmod2 = 0x60000005;
inline long long sqr(long long x) { return x * x; }
inline int sqr(int x) { return x * x; }
inline double sqr(double x) { return x * x; }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d;
  (b == 0 ? (x = 1, y = 0, d = a)
          : (d = exgcd(b, a % b, y, x), y -= a / b * x));
  return d;
}
long long qpow(long long a, long long n) {
  long long sum = 1;
  while (n) {
    if (n & 1) sum = sum * a;
    a = a * a;
    n >>= 1;
  }
  return sum;
}
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return (x > 0 ? 1 : -1);
}
int x[MAXN], y[MAXN];
int a[MAXN], p[MAXN], cnt;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i < MAXN; i++) {
    if (a[i] == 0) {
      p[cnt++] = i;
      for (int j = 2 * i; j < MAXN; j += i) a[j] = 1;
    }
  }
  int T;
  cin >> T;
  while (T--) {
    vector<pair<long long, long long> > st;
    int len = 0, mx = 1e9 + 10, ans = 1, cur = 0;
    for (int i = 0; i < 22; i++) {
      long long v = 1, g;
      for (int i = 0; i < len; i++) v = v * qpow(x[i], y[i]);
      while (1) {
        if ((long double)v * p[cur] > 1e18 - 10) break;
        x[len] = p[cur], y[len] = 1;
        v = v * p[cur++];
        len++;
      }
      cout << "? " << v << endl;
      cout.flush();
      cin >> g;
      for (int i = 0; i < len; i++) {
        if (g % qpow(x[i], y[i]) == 0) {
          mx /= x[i];
          st.push_back(pair<int, int>(x[i], y[i] + 1));
          ans = ans / y[i] * (y[i] + 1);
        }
      }
      len = st.size();
      for (int i = 0; i < len; i++) x[i] = st[i].first, y[i] = st[i].second;
      st.clear();
    }
    int num = 1;
    double tim = p[cur];
    while (tim * p[cur] <= mx) tim *= p[cur], num++;
    cout << "! " << ans * (1 << (num - 1)) << endl;
    cout.flush();
  }
  return 0;
}
