#include <bits/stdc++.h>
using namespace std;
long long int mod = 998244353;
long long int INF = 1e18;
long long int po(long long int a, long long int b) {
  long long int re = 1;
  while (b) {
    if (b % 2 == 1) {
      re = (re * a);
    }
    a = (a * a);
    b >>= 1;
  }
  return re;
}
vector<long long int> pri;
bool p[100001];
int main() {
  int test = 1;
  for (int i = (2); i < (100001); i++) {
    if (p[i] == 0) {
      pri.push_back(i);
      for (int j = 2 * i; j < 1001; j += i) p[j] = 1;
    }
  }
  cin >> test;
  while (test--) {
    long long int q, x = 1, r = 1000000000, g, g2;
    int j = 0, pj = 0;
    vector<long long int> oc;
    int i = 0;
    while (1) {
      q = 1;
      pj = j;
      while (q < 1e15) {
        q *= pri[j];
        j++;
      }
      cout << "? " << q << '\n';
      cin >> g;
      i++;
      if (i == 22) break;
      q = 1;
      for (int k = (pj); k < (j); k++) {
        if (g % pri[k] == 0) {
          oc.push_back(pri[k]);
          if (q == 1) {
            q = po(pri[k], (log(r) / log(pri[k])));
          } else {
            q *= po(pri[k], (log(r) / log(pri[k])));
            cout << "? " << q << '\n';
            cin >> g2;
            i++;
            if (i == 22) break;
            q = 1;
            x *= g2;
            r /= g2;
          }
        }
      }
      if (i >= 22) break;
      if (q > 1) {
        cout << "? " << q << '\n';
        cin >> g2;
        i++;
        if (i == 22) break;
        q = 1;
        x *= g2;
        r /= g2;
      }
    }
    long long int ans = 1, ni = 9;
    for (int i = (0); i < (oc.size()); i++) {
      int c = 1;
      while (x % oc[i] == 0) {
        c++;
        x /= oc[i];
      }
      ans *= c;
    }
    cout << "! " << max(ans * 2, ans + 7) << '\n';
  }
  return 0;
}
