#include <bits/stdc++.h>
using namespace std;
const int Mp = 4000;
const int Mx = 1000000000;
int T, used;
int pos[Mp], res;
template <typename T>
void debug(T x, char c = '\n') {
  cerr << x << c;
}
template <typename T>
void debug(T *const tp, int minn, int maxn, char v = ' ', char c = '\n') {
  for (int i = minn; i <= maxn; ++i) debug(tp[i], v);
  cerr << c;
}
namespace Euler {
bitset<51000> vis;
int pr[51000], A, i, j, cnt;
void Ego() {
  int N = sqrt(Mx);
  vis[1] = vis[0] = 1;
  for (i = 2; i <= N; ++i) {
    if (!vis[i]) pr[++cnt] = i;
    for (j = 1; j <= cnt; ++j) {
      if (i * pr[j] > N) break;
      vis[i * pr[j]] = 1;
      if (!(i % pr[j])) break;
    }
  }
}
}  // namespace Euler
int tp;
int ng;
int tot;
long long gp[Mp];
int stk[Mp];
int lrg[Mp];
int rrg[Mp];
int main() {
  cin >> T;
  Euler ::Ego();
  lrg[tot = 1] = 1;
  using namespace Euler;
  int x, y, z, q1, q2;
  long long o = 1;
  for (int i = 1; i <= cnt; ++i) pos[i] = log(Mx) / log(pr[i]);
  for (int i = 1; i <= cnt; ++i) {
    if (1.0 * o * pr[i] > 1e18)
      gp[tot] = o, rrg[tot] = i - 1, lrg[++tot] = i, o = 1;
    o *= pr[i];
  }
  while (T--) {
    ng = 1;
    res = 1;
    used = 0;
    do {
      tp = 0;
      ++used;
      cout << "? " << gp[ng] << endl, cin >> y;
      for (int i = lrg[ng]; i <= rrg[ng]; ++i)
        if (y % pr[i] == 0) stk[++tp] = i;
      for (int i = 1; i <= tp;) {
        if (used >= 22) break;
        q1 = 0, q2 = 0;
        x = 1, z = 1;
        x = pow(pr[stk[i]], pos[stk[i]]);
        if (i < tp) z = pow(pr[stk[i + 1]], pos[stk[i + 1]]);
        cout << "? " << 1ll * x * z << '\n';
        cin >> y;
        ++used;
        while (y % pr[stk[i]] == 0) ++q1, y /= pr[stk[i]];
        if (i < tp)
          while (y % pr[stk[i + 1]] == 0) ++q2, y /= pr[stk[i + 1]];
        res *= (q1 + 1) * (q2 + 1);
        i += 2;
      }
      ++ng;
    } while (used < 22);
    cout << "! " << max(res * 2, res + 7) << endl;
  }
  return 0;
}
