#pragma GCC optimize("Ofast") #include using namespace std; typedef long long int ll; typedef unsigned long long int ull; mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()); ll myRand(ll B) { return (ull)rng() % B; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin >> n; int res = -1; if (n%2) res = n-1; for (int i = 0; i+1 < n; i += 2) { cout << "? " << i << " " << i+1 << endl; int x; cin >> x; if (x == i) { res = i+1; } else if (x == i+1) { res = i; } } cout << "! " << res << endl; }