#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p);
template <class T>
ostream &operator<<(ostream &os, vector<T> &v);
template <class T>
ostream &operator<<(ostream &os, set<T> &v);
template <class T1, class T2>
ostream &operator<<(ostream &os, map<T1, T2> &v);
const long long mod = 1e9 + 7;
const int N = 31622 + 5;
long long asol;
set<long long> prime;
bool mark[N + 1];
void sieve() {
  int i, j, limit = sqrt(N) + 2, n = N;
  mark[1] = 1;
  for (i = 4; i <= n; i += 2) mark[i] = 1;
  prime.insert(2);
  for (i = 3; i <= n; i++) {
    if (!mark[i]) {
      prime.insert((long long)i);
      if (i <= limit) {
        for (j = i * i; j <= n; j += i * 2) {
          mark[j] = 1;
        }
      }
    }
  }
}
long long query(long long x) {
  cout << "? " << x << endl;
  cout.flush();
  long long g;
  cin >> g;
  return g;
}
long long max1 = 1e18, max2 = 1e9;
void TEST_CASES(int cas) {
  long long cnt = 21;
  set<long long> st = prime;
  long long ans = 1;
  long long prv = -1;
  while (cnt) {
    if (cnt == 1 && prv != -1) {
      long long t1 = prv;
      while (1) {
        if (t1 * prv > max2) {
          break;
        }
        t1 *= prv;
      }
      long long p = query(t1);
      long long sawa = prv;
      cnt--;
      long long c1 = 0;
      while (p % sawa == 0) {
        p /= sawa;
        c1++;
      }
      ans *= (c1 + 1);
      break;
    }
    long long mul = 1;
    vector<long long> f, f2;
    if (prv != -1) {
      f2.push_back(prv);
      prv = -1;
    }
    while (1) {
      auto it = st.begin();
      long long val = *it;
      if (val * mul <= max1 && (val * mul) > mul) {
        mul *= val;
        f.push_back(val);
        st.erase(val);
      } else {
        break;
      }
    }
    long long ret = query(mul);
    cnt--;
    for (long long i : f) {
      if (ret % i == 0) {
        f2.push_back(i);
        ret /= i;
      }
    }
    long long sz = f2.size();
    if (sz % 2) {
      prv = f2.back();
      f2.pop_back();
      sz--;
    }
    if (sz == 0) continue;
    for (long long i = 0; i < f2.size(); i += 2) {
      if (cnt == 0) break;
      long long t1 = f2[i], t2 = f2[i + 1];
      while (1) {
        if (t1 * f2[i] > max2) {
          break;
        }
        t1 *= f2[i];
      }
      while (1) {
        if (t2 * f2[i + 1] > max2) {
          break;
        }
        t2 *= f2[i + 1];
      }
      long long now = t1 * t2;
      long long sawa = f2[i], dhon = f2[i + 1];
      long long p = query(now);
      cnt--;
      long long c1 = 0;
      while (p % sawa == 0) {
        p /= sawa;
        c1++;
      }
      ans *= (c1 + 1);
      c1 = 0;
      while (p % dhon == 0) {
        p /= dhon;
        c1++;
      }
      ans *= (c1 + 1);
    }
  }
  if (ans == 1) {
    ans = 8;
  } else {
    ans *= 2;
  }
  cout << "! " << ans << endl;
  cout.flush();
  return;
}
int main() {
  sieve();
  int t = 1, cas = 0;
  scanf("%d", &t);
  while (t--) {
    TEST_CASES(++cas);
  }
  return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, pair<T1, T2> &p) {
  os << "{" << p.first << ", " << p.second << "} ";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "[ ";
  for (int i = 0; i < v.size(); i++) {
    os << v[i] << " ";
  }
  os << " ]";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, set<T> &v) {
  os << "[ ";
  for (T i : v) {
    os << i << " ";
  }
  os << " ]";
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, map<T1, T2> &v) {
  for (auto i : v) {
    os << "Key : " << i.first << " , Value : " << i.second << endl;
  }
  return os;
}
