// #pragma GCC optimize ("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target ("avx,avx2,fma") #include using std::cin, std::cout, std::cerr; using ll = long long; bool Check(int x, int ax, int y) { std::set set; for(int i = 0; i < 100; i ++) for(int j = i + 1; j <= 100; j ++) if((i + x) % j == ax) { int ay = (i + y) % j; if(set.count(ay)) return false; set.insert(ay); } return true; } int Ask(int x) { cout << "? " << x << '\n'; cout.flush(); int a; cin >> a; return a; } void Answer(int a, int b) { cout << "! " << a << ' ' << b << '\n'; cout.flush(); } int main() { std::ios::sync_with_stdio(false); // for(int x = 1; x <= 100; x ++) { // bool ok = true; // for(int ax = 0; ax < 100; ax ++) { // bool f = false; // for(int y = 1; y <= 100; y ++) { // if(Check(x, ax, y)) { // f = true; // break; // } // } // if(!f) ok = false; // } // if(ok) // cout << x << '\n'; // } int x = 100; int ax = Ask(x); int y; for(int i = 1; i <= 100; i ++) if(Check(x, ax, i)) { y = i; break; } int ay = Ask(y); for(int a = 0; a < 100; a ++) for(int b = a + 1; b <= 100; b ++) if((x + a) % b == ax && (y + a) % b == ay) Answer(a, b); }