#include // #include using namespace std; // using namespace atcoder; typedef int64_t lint; #define rep(i, n) for(int i=0; i; using vvi = vector>; template inline void vin(vector& v) { rep(i, v.size()) cin >> v.at(i); } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template inline void drop(T x) { cout << x << endl; exit(0); } template void vout(vector v) { rep(i, v.size()) { cout << v.at(i) << ' '; } cout << endl; } constexpr lint LINF = LLONG_MAX/2; int main() { lint N; cin >> N; lint a=0, b=0, c=0, x, y, z; std::cout << "?" << ' ' << 1 << endl; cin >> x; std::cout << "?" << ' ' << N-1 << endl; cin >> y; if (x == 0 && y == N/2-1) { std::cout << "!" << ' ' << 2 << ' ' << N-1 << endl; exit(0); } else if (x == 1 && y == N/2) { std::cout << "!" << ' ' << 2 << ' ' << N-1 << endl; exit(0); } std::cout << "?" << ' ' << N/2 << endl; cin >> z; if (z*2 == N/2) { std::cout << "!" << ' ' << 1 << ' ' << N/2 << endl; exit(0); } if (z*2 >= N/2) { if (x == 0) { a = 0, b = N/2; } else { a = N/2, b = N; } } else { if (x == 0) { a = N/2, b = N; } else { a = 0, b = N/2; } } while (b-a > 1) { // list(a) show(b) c = (a+b)/2; c += c%2; std::cout << "?" << ' ' << c << endl; cin >> z; if (z == c/2) { if (c < N/2) std::cout << "!" << ' ' << c+1 << ' ' << N << endl; else std::cout << "!" << ' ' << 1 << ' ' << c << endl; exit(0); } else if (z > c/2) { if (c < N/2) b = c; else a = c; } else { if (c < N/2) a = c; else b = c; } } }