#include <bits/stdc++.h>
long long query(long long q) {
  std::printf("? %lld\n", q);
  std::fflush(stdout);
  long long res;
  std::scanf("%lld", &res);
  return res;
}
long long qpow(long long a, int b) {
  long long res = 1;
  while (b) {
    if (b & 1) res *= a;
    b >>= 1, a *= a;
  }
  return res;
}
long long tmp;
int prime[] = {2,   3,   5,   7,   11,  13,  17,  19,  23,  29,  31,  37,  41,
               43,  47,  53,  59,  61,  67,  71,  73,  79,  83,  89,  97,  101,
               103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167,
               173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239,
               241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313,
               317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397,
               401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467,
               479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569,
               571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643,
               647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719};
int get(int val) {
  long long now = val;
  while (now * val <= int(1e9)) now *= val;
  long long t = query(now);
  int res = 0;
  while (t % val == 0) t /= val, ++res;
  return res;
}
int ans = 1, us = 0;
int mian() {
  int next = 0;
  us = 0, ans = 1;
  while (us < 21) {
    if (prime[next] == 719) break;
    long long p = 1;
    int last = next;
    while (p * prime[next] < 1e15 && prime[next] != 719) p *= prime[next++];
    tmp = query(p);
    ++us;
    for (int i = last; i < next; ++i)
      if (tmp % prime[i] == 0 && us < 22) {
        int ga = get(prime[i]);
        ++us;
        ans *= ga + 1;
      }
  }
  std::printf("! %d\n", std::max(ans + 7, ans * 2));
  std::fflush(stdout);
  return 0;
}
int main() {
  int t;
  std::scanf("%d", &t);
  while (t--) mian();
}
