#include <bits/stdc++.h>
using namespace std;
int flag[1005], T, cnt, n;
int ask(long long x) {
  printf("? %lld\n", x);
  fflush(stdout);
  scanf("%lld", &x);
  return (int)x;
}
int main() {
  for (int i = 2; i <= 1000; i++)
    if (!flag[i])
      for (int j = 2 * i; j <= 1000; j += i) flag[j] = 1;
  scanf("%d", &T);
  while (T--) {
    long long s = 1;
    vector<int> v;
    cnt = 0;
    for (int i = 2; i <= 1000; i++)
      if (!flag[i]) {
        if (1e18 / s >= i)
          s *= i;
        else {
          int x = ask(s);
          for (int j = 2; j <= 1000; j++)
            if (!flag[j] && x % j == 0) v.push_back(j);
          cnt++;
          s = i;
          if (cnt == 17) break;
        }
      }
    int ans = 1;
    for (int i = 0; i < v.size(); i += 2) {
      long long v1 = 1, v2 = 1;
      for (; 1e9 / v1 >= v[i]; v1 *= v[i])
        ;
      if (i < v.size() - 1)
        for (; 1e9 / v2 >= v[i + 1]; v2 *= v[i + 1])
          ;
      int x = ask(v1 * v2);
      int cnt = 1;
      while (x % v[i] == 0) x /= v[i], cnt++;
      ans *= cnt;
      if (i < v.size() - 1) {
        cnt = 1;
        while (x % v[i + 1] == 0) x /= v[i + 1], cnt++;
        ans *= cnt;
      }
    }
    if (!v.size())
      puts("! 7");
    else if (v.size() == 1 && ans == 2)
      puts("! 8");
    else
      printf("! %d\n", ans * 2);
    fflush(stdout);
  }
}
