#include <bits/stdc++.h>
using namespace std;
bool is_prime(int num) {
  for (int i = 2; i * i <= num; i++)
    if (num % i == 0) return false;
  return true;
}
int t;
void read() { cin >> t; }
const long long inf = 1e18;
long long ask(long long q) {
  cout << "? " << q << endl;
  long long res;
  cin >> res;
  return res;
}
void solve() {
  vector<int> primes;
  for (int i = 2; i <= 800; i++)
    if (is_prime(i)) primes.push_back(i);
  vector<long long> to_check;
  for (int i = 0; i < (int)primes.size(); i++) {
    int j;
    long long pr = 1;
    for (j = i; j < (int)primes.size(); j++) {
      if ((double)inf / primes[j] < pr) break;
      pr *= primes[j];
    }
    to_check.push_back(pr);
    i = j;
  }
  while (t--) {
    vector<long long> curr_pr;
    for (auto i : to_check) {
      auto curr = ask(i);
      for (auto j : primes)
        if (curr % j == 0) curr_pr.push_back(j);
    }
    long long d = 1;
    for (int i = 0; i < (int)curr_pr.size(); i += 2) {
      long long num = 1;
      for (;;) {
        num *= curr_pr[i];
        if (num > 1000000000) break;
      }
      num /= curr_pr[i];
      long long num1 = 1;
      if (i != (int)curr_pr.size() - 1) {
        for (;;) {
          num1 *= curr_pr[i + 1];
          if (num1 > 1000000000) break;
        }
        num1 /= curr_pr[i + 1];
      }
      num *= num1;
      auto curr = ask(num);
      int cnt1 = 0;
      while (curr % curr_pr[i] == 0) cnt1++, curr /= curr_pr[i];
      d *= (cnt1 + 1);
      if (i != (int)curr_pr.size() - 1) {
        cnt1 = 0;
        while (curr % curr_pr[i + 1] == 0) cnt1++, curr /= curr_pr[i + 1];
        d *= (cnt1 + 1);
      }
    }
    cout << "! " << d * 2 << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  read();
  solve();
}
