#include // exit #include // cin, cout, ios #include namespace mp = boost::multiprecision; using bigint = mp::cpp_int; void check(bigint const& n, bigint const& v) { bigint g = mp::gcd(v, n); if(g > 2 && g < n) { std::cout << "! " << g << " " << n / g << '\n'; std::exit(0); } } int main() { bigint n, r; std::cin >> n; check(n, 3); for(int a = 2;; a += 1) { check(n, a); std::cout << "? " << a << '\n'; std::cin >> r; if((r & 1) == 0) { r >>= 1; } for(int b = 0; b < 99; b += 1) { check(n, mp::powm(a + b, r, n) - 1); } } }