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