#include #include using namespace std; using namespace atcoder; using ll = long long; using ld = long double; using mint = modint998244353; int main() { int N, z; cin >> N; if (N % 2 == 0) { for (int i = 0; i < N; i += 2) { cout << "? " << i << ' ' << i + 1 << endl; cin >> z; if (z == i) { cout << "! " << i + 1 << endl; return 0; } if (z == i + 1) { cout << "! " << i << endl; return 0; } } } else { for (int i = 0; i < N - 1; i += 2) { cout << "? " << i << ' ' << i + 1 << endl; cin >> z; if (z == i) { cout << "! " << i + 1 << endl; return 0; } if (z == i + 1) { cout << "! " << i << endl; return 0; } } cout << "! " << N - 1 << endl; } ; return 0; }