#include <bits/stdc++.h>
using namespace std;
const unsigned long long maxi = 1e18;
bool isprime(unsigned long long n) {
  if (n < 4) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (unsigned long long i = 3; i * i <= n; i += 2)
    if (n % i == 0) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    unsigned long long p = 1;
    int id;
    for (unsigned long long i = 2; i <= 90000; i++)
      if (isprime(i)) {
        if (p * i > maxi) {
          id = i;
          break;
        }
        p *= i;
      }
    int nb = 1;
    map<unsigned long long, bool> visited;
    while (true) {
      fflush(stdout);
      cout << "? " << p << endl;
      unsigned long long GCD;
      cin >> GCD;
      int ans = 1;
      unsigned long long G = GCD;
      if (nb == 21) {
        for (unsigned long long i = 2; i * i <= G; i++) {
          int nb = 0;
          while (GCD % i == 0) {
            nb++;
            GCD /= i;
          }
          ans *= (nb + 1);
        }
        if (GCD != 1) ans *= 2;
        if (ans < 3) ans = 4;
        cout << "! " << ans * 2 << endl;
        break;
      }
      p = GCD * GCD;
      if (visited[p]) p = GCD;
      visited[p] = true;
      for (unsigned long long i = id; i <= 90000; i++) {
        if (isprime(i)) {
          if (p > (maxi / i)) {
            id = i;
            break;
          }
          p *= i;
        }
      }
      nb++;
    }
    visited.clear();
  }
}
