#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
template <class T>
inline bool setmin(T &a, T b) {
  if (a > b) return a = b, 1;
  return 0;
}
template <class T>
inline bool setmax(T &a, T b) {
  if (a < b) return a = b, 1;
  return 0;
}
template <class T>
inline T fast(T a, T b, T mod) {
  long long res = 1;
  while (b) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
template <class T>
istream &operator>>(istream &os, vector<T> &container) {
  for (auto &u : container) os >> u;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &container) {
  for (auto &u : container) os << u << " ";
  return os;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) swap(a %= b, b);
  return a;
}
const long long INF = 1e9 + 7;
const long long mod = 998244353;
const long long BIG_INF = 1e18;
const long long N = 1e6 + 7;
const long long T = 1 << 20;
const long double inf = 1e18;
long long n, m, k, q;
long long a, r;
vector<long long> tab;
const int NN = 10000;
int composite[NN];
void sieve() {
  for (int i = 2; i < NN; i++)
    if (!composite[i])
      for (int j = i * i; j < NN; j += i) composite[j] = i;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  sieve();
  cin >> q;
  while (q--) {
    int last = 2;
    int ile_zadalem = 0;
    long long iloczyn_X = 1;
    long long iloczyn_dzielnikow = 1;
    while (ile_zadalem < 22) {
      long long pom = 1;
      vector<int> aktualne;
      while (1) {
        if (composite[last])
          last++;
        else if (pom > BIG_INF / last)
          break;
        else {
          pom *= last;
          if (pom > BIG_INF) {
            pom /= last;
            break;
          }
          aktualne.push_back(last);
          last++;
        }
      }
      ile_zadalem++;
      cout << "? " << pom << endl;
      long long GCD;
      cin >> GCD;
      for (auto &u : aktualne)
        if (GCD % u == 0 and ile_zadalem < 22) {
          ile_zadalem++;
          long long ilo = 1;
          while (1) {
            if (ilo > BIG_INF / u) break;
            ilo *= u;
          }
          if (ilo > BIG_INF) ilo /= u;
          cout << "? " << ilo << endl;
          long long GCD2;
          cin >> GCD2;
          int wyk = 0;
          while (GCD2 > 1) {
            GCD2 /= u;
            wyk++;
          }
          iloczyn_X *= GCD2;
          iloczyn_dzielnikow *= (wyk + 1);
        }
    }
    if (iloczyn_dzielnikow > 7) {
      cout << "! " << iloczyn_dzielnikow * 2 << endl;
    } else
      cout << "! " << iloczyn_dzielnikow + 7 << endl;
  }
}
