#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int N = 701;
bool prime[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 2; i < N; i++) prime[i] = true;
  vector<long long> ans;
  for (int i = 2; i < N; i++) {
    if (prime[i]) {
      ans.push_back(i);
      for (int j = i + i; j < N; j += i) {
        prime[j] = false;
      }
    }
  }
  long long cur = 1e18;
  int qrs = 0;
  vector<long long> z;
  sort(ans.rbegin(), ans.rend());
  auto ask = [&](long long x) {
    cout << "? " << x << endl;
    int y;
    cin >> y;
    return y;
  };
  for (long long x : ans) {
    bool good = false;
    sort(z.rbegin(), z.rend());
    for (long long &p : z) {
      if (p <= cur / x) {
        good = true;
        p *= x;
        break;
      }
    }
    if (!good) z.push_back(x);
  }
  int ts;
  cin >> ts;
  while (ts--) {
    vector<long long> ok;
    for (long long p : z) {
      int t = ask(p);
      for (int i = 2; i * i <= t; i++) {
        if (t % i == 0) {
          ok.push_back(i);
          t /= i;
        }
      }
      if (t != 1) ok.push_back(t);
    }
    int mda = 1e9;
    for (long long &x : ok) {
      long long y = x;
      while (x * y <= mda) {
        x *= y;
      }
    }
    long long ans = 1;
    for (int i = 0; i < (int)ok.size(); i += 2) {
      long long me = ok[i];
      if (i + 1 < (int)ok.size()) me *= ok[i + 1];
      long long t = ask(me);
      for (int i = 2; i * i <= t; i++) {
        int deg = 0;
        while (t % i == 0) {
          t /= i;
          deg++;
        }
        ans *= (deg + 1);
      }
      if (t != 1) ans *= 2;
    }
    cout << "! " << max(7ll, ans) + ans << endl;
  }
}
