#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n; cin >> n; int l = 0, r = n + 1; int cnt = 0; while (l + 1 < r) { int mid = (l + r) / 2; cout << "? " << mid << endl; int c; cin >> c; if (c == mid) { l = mid; } else { r = mid; } } assert(l + 1 == r); while (cnt < 10) { cnt++; cout << "? " << l << endl; int c; cin >> c; } cout << "! " << l << " " << r << endl; }