#include <bits/stdc++.h>
using namespace std;
template <class T>
void Output(const T& v, bool print_new_line = true) {
  bool first = true;
  for (auto element : v) {
    if (!first)
      cout << " ";
    else
      first = false;
    cout << element;
  }
  if (print_new_line) cout << endl;
}
template <class T>
void Input(vector<T>& v, int n) {
  v.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
}
template <class T>
vector<int> Query(const T& c, int answer_counts) {
  cout << "? " << c.size();
  for (auto it = c.begin(); it != c.end(); ++it) {
    cout << " " << (*it);
  }
  cout << endl;
  cout.flush();
  vector<int> s(answer_counts);
  for (int i = 0; i < answer_counts; ++i) {
    cin >> s[i];
  }
  return s;
}
static const long long M = 1e18;
static const long long MAX = 1e9;
long long get(int a, int n) {
  long long s = a;
  while (--n > 0) {
    s *= a;
  }
  return s;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  vector<int> p;
  p.push_back(2);
  vector<bool> f(1000, true);
  for (int i = 3; i < 1000; i += 2) {
    if (f[i]) {
      p.push_back(i);
      for (int j = i; j < 1000; j += i) {
        f[j] = false;
      }
    }
  }
  int case_number;
  cin >> case_number;
  for (int case_index = 0; case_index < case_number; ++case_index) {
    map<int, int> known;
    map<int, pair<int, int>> to_test;
    int tested = 0;
    long long base = 1;
    for (int i = 0; i < 22; ++i) {
      long long q = 1;
      for (auto p : to_test) {
        int c = (p.second.first + p.second.second) / 2;
        long long t = get(p.first, c);
        if (M / q >= t) {
          q *= t;
        }
      }
      while (tested < p.size()) {
        if (M / q >= p[tested]) {
          q *= p[tested];
          to_test[p[tested]] = make_pair(-1, -1);
          ++tested;
        } else {
          break;
        }
      }
      if (q == 1) {
        break;
      }
      cout << "? " << q << endl;
      cout.flush();
      long long r;
      cin >> r;
      map<int, pair<int, int>> new_to_test;
      long long base = 1;
      for (auto p : known) {
        base *= get(p.first, p.second);
      }
      for (const auto p : to_test) {
        auto range = p.second;
        if (p.second.first == -1) {
          if (r % p.first == 0) {
            range.first = 1;
            range.second =
                (int)((log(MAX / base) + log(p.first)) / log(p.first));
            if (range.second <= 2) {
              known[p.first] = 1;
            } else {
              new_to_test[p.first] = range;
            }
            base *= p.first;
          }
        } else {
          int c = (p.second.first + p.second.second) / 2;
          if (r % (get(p.first, c)) == 0) {
            range.first = c;
          } else {
            range.second = c;
          }
          if (range.second - range.first == 1) {
            known[p.first] = range.first;
          } else {
            new_to_test[p.first] = range;
          }
          base *= get(p.first, range.first);
        }
      }
      to_test = new_to_test;
    }
    int ans = 2;
    for (auto p : known) {
      ans *= (p.second + 1);
    }
    cout << "! " << ans << endl;
  }
  return 0;
}
