#include <bits/stdc++.h>
using std::priority_queue;
using std::queue;
using std::sort;
using std::vector;
int n;
char s[1111111];
long long a[1111111];
long long v[] = {
    383968065761280000ll, 355184020551795241ll, 382335214319607917ll,
    776093850365240417ll, 239868713978954299ll, 9879251463499721ll,
    45002749555625027ll,  144444194443976579ll, 473141564456317433ll,
    3068689788020071ll,   5910838774210927ll,   9797084445859807ll,
    17092564102090369ll,  32156968791364271ll,  49010633640532829ll,
    72410448629704357ll,  106872689098341317ll};
long long gcd(long long x, long long y) {
  long long r = 1;
  for (; r; r = x % y, x = y, y = r)
    ;
  return x;
}
long long lcm(long long x, long long y) {
  long long g = gcd(x, y);
  return x / g * y;
}
long long d(long long x) {
  register int i;
  long long ret = 1;
  for (i = 2; i <= x / i; i++) {
    if (x % i == 0) {
      long long s = 1;
      while (x % i == 0) x /= i, s++;
      ret *= s;
    }
  }
  if (x ^ 1) ret *= 2;
  ret *= 2;
  if (ret < 8) ret = 8;
  return ret;
}
void exec() {
  register int i, ii, iii;
  long long rev = 1;
  for (i = 0; i < 17; i++) {
    printf("? %lld\n", v[i]);
    fflush(stdout);
    long long g;
    scanf("%lld", &g), rev = lcm(rev, g);
  }
  printf("! %lld\n", d(rev));
  fflush(stdout);
}
int main() {
  int T = 1;
  scanf("%d", &T);
  while (T--) exec();
}
