#include <bits/stdc++.h>
using namespace std;
const int maxn = 100100;
int isprime[maxn], n = 100000;
vector<int> V;
inline long long query(long long x) {
  printf("? %lld\n", x);
  fflush(stdout);
  int ans;
  scanf("%d", &ans);
  return ans;
}
vector<int> v, tmp;
int main() {
  for (int i = 2; i <= n; i++) isprime[i] = 1;
  for (int i = 2; i <= n; i++)
    if (isprime[i])
      for (int j = i + i; j <= n; j += i) isprime[j] = 0;
  for (int i = 1; i <= n; i++)
    if (isprime[i]) V.push_back(i);
  int T;
  scanf("%d", &T);
  while (T--) {
    v.clear();
    long long now = 1;
    for (int i = 0; i <= 125; i++) {
      if ((log(now) + log(V[i])) / log(10) > 17.99) {
        long long ttt = query(now);
        for (int j = 0; j < (int)tmp.size(); j++)
          if (ttt % tmp[j] == 0) v.push_back(tmp[j]);
        tmp.clear();
        now = 1;
      }
      now = 1ll * now * V[i];
      tmp.push_back(V[i]);
    }
    long long ans = 1;
    if (v.size() & 1) {
      int vv = v[v.size() - 1];
      now = 1;
      while (now * vv <= 1e9) now *= vv;
      long long ttt = query(now);
      int cnt = 0;
      while (ttt % vv == 0) ttt /= vv, cnt++;
      ans *= (cnt + 1);
    }
    for (int i = 0; i + 1 < (int)v.size(); i += 2) {
      now = 1;
      long long nowb = 1;
      while (now * v[i] <= 1e9) now *= v[i];
      while (nowb * v[i + 1] <= 1e9) nowb *= v[i + 1];
      long long ttt = query(now * nowb);
      int cnt = 0, cntb = 0;
      while (ttt % v[i] == 0) ttt /= v[i], cnt++;
      while (ttt % v[i + 1] == 0) ttt /= v[i + 1], cntb++;
      ans *= (cnt + 1) * (cntb + 1);
    }
    printf("! %lld\n", max(ans * 2, ans + 7));
    fflush(stdout);
  }
}
