#include <bits/stdc++.h>
using namespace std;
int query(long long x) {
  cout << "? " << x << endl;
  int res;
  cin >> res;
  return res;
}
void answer(int ans) { cout << "! " << ans << endl; }
vector<long long> prime, p, q;
int vis[1100];
int main() {
  for (int i = 2; i <= 1000; ++i) {
    if (vis[i]) continue;
    prime.push_back(i);
    for (int j = i; j <= 1000; j += i) vis[j] = 1;
  }
  int Max = 1024;
  for (long long &v : prime) {
    long long t = v;
    while (t <= Max) t *= v;
    t /= v;
    p.push_back(t);
  }
  long long qMax = 1e18;
  for (int i = 0; i < p.size();) {
    long long x = 1;
    while (i < p.size() && qMax / x >= p[i]) {
      x *= p[i++];
    }
    q.push_back(x);
  }
  int t;
  cin >> t;
  while (t--) {
    int ans = 1;
    for (int i = 0; i < 22; ++i) {
      int v = query(q[i]);
      for (long long &x : prime) {
        int c = 0;
        while (v % x == 0) ++c, v /= x;
        ans *= (c + 1);
      }
    }
    answer(ans * 2);
  }
  return 0;
}
