#include using namespace std; using ll = long long; using P = pair; #define rep(i, n) for(ll i = 0; i < n; i++) #define all(x) (x).begin(),(x).end() templatebool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;} templatebool chmax(T&a, const T&b){if(a> n; vector pn(n+100,true); while(res>=0){ out = pre = 1; while(!pn[now]) now++; if(now>n) break; for(int i=now;i<=n;i+=now) pn[i] = false; while(1){ out *= now; if(out*ans>n) break; cout << "? " << out << '\n' << flush; cin >> res; if(res==pre || res<0) break; pre = res; } ans *= pre; } cout << "! " << ans << '\n' << flush; return 0; }