#include <bits/stdc++.h>
using namespace std;
const long long q[22] = {
    2ll * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 29 * 31 * 37 * 41 * 43 * 47,
    53ll * 59 * 61 * 63 * 67 * 71 * 73 * 79 * 83,
    89ll * 97 * 101 * 103 * 107 * 109 * 113 * 127,
    131ll * 137 * 139 * 149 * 151 * 157 * 163,
    167ll * 173 * 179 * 181 * 191 * 193 * 197,
    199ll * 211 * 223 * 227 * 229 * 233 * 239,
    241ll * 251 * 257 * 263 * 269 * 271 * 277,
    281ll * 283 * 293 * 307 * 311 * 313 * 317,
    331ll * 337 * 347 * 349 * 353 * 359 * 367,
    373ll * 379 * 383 * 389 * 397 * 401,
    409ll * 419 * 421 * 431 * 433 * 439,
    443ll * 449 * 457 * 461 * 463 * 467,
    479ll * 487 * 491 * 499 * 503 * 509,
    521ll * 523 * 541 * 547 * 557 * 563,
    569ll * 571 * 577 * 587 * 593 * 599,
    601ll * 607 * 613 * 617 * 619 * 631};
const long long cnt[22] = {53,  89,  131, 167, 199, 241, 281, 331,
                           373, 409, 443, 479, 521, 569, 601, 641};
const long long prime[205] = {
    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};
const long long ask[105] = {
    536870912, 387420489, 244140625, 282475249, 214358881, 815730721, 410338673,
    893871739, 148035889, 594823321, 887503681, 69343957,  115856201, 147008443,
    229345007, 418195493, 714924299, 844596301, 20151121,  25411681,  28398241,
    38950081,  47458321,  62742241,  88529281,  104060401, 112550881, 131079601,
    141158161, 163047361, 260144641};
int main() {
  long long t;
  cin >> t;
  for (long long ans, now, mx; t; --t) {
    ans = 1, now = 0, mx = 1000000000;
    for (long long i = 0, gcd; i < 16; ++i) {
      cout << "? " << q[i] << endl, cin >> gcd;
      for (long long g; prime[now] < cnt[i]; ++now)
        if (gcd % prime[now] == 0) {
          long long num = 1, que = 1;
          cerr << prime[now] << endl;
          while (que < mx) que *= prime[now];
          cout << "? " << que << endl, cin >> g, mx /= g;
          while (g % prime[now] == 0) ++num, g /= prime[now];
          cerr << num << endl;
          ans *= num;
        }
      if (mx < cnt[i] * cnt[i] * cnt[i]) {
        cout << "! " << ans * 2 << endl;
        goto N;
      }
    }
    if (ans == 1 || ans == 2)
      cout << "! 8" << endl;
    else
      cout << "! " << ans * 2 << endl;
  N:;
  }
}
