#include using namespace std; #ifdef LOCAL #include "debug.hpp" #else #define debug(...) 1 #endif struct xorshift { using u32 = uint32_t; u32 x = 123456789, y = 362436069, z = 521288629, w = 88675123; xorshift(u32 seed = 0) { z ^= seed; } u32 operator()() { u32 t = x ^ (x << 11); x = y; y = z; z = w; return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)); } } rnd; int randint(int l, int r) { return l + rnd() % (r - l + 1); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); auto Ask = [&] (int x) { cout << "? " << x << endl; int ret; cin >> ret; return ret; }; int y1 = Ask(100); vector> can; for (int a = 0; a < 100; a++) { for (int b = a + 1; b <= 100; b++) { if ((a + 100) % b == y1) { can.push_back(make_pair(a, b)); } } } for (int i = 1; i <= 100; i++) { set z; for (auto [u, v] : can) { z.insert((u + i) % v); } if (can.size() == z.size()) { int y2 = Ask(i); for (auto [u, v] : can) { if (y2 == (u + i) % v) { cout << "! " << u << ' ' << v << endl; return 0; } } } } }