#pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include using namespace std; using namespace atcoder; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for( int i = 0; i+1 < N; i+=2 ) { int z; cout << "? " << i << ' ' << i+1 << endl; cin >> z; if( z == i ) { cout << "! " << i+1 << endl; return 0; }else if( z == i+1 ) { cout << "! " << i << endl; } } cout << "! " << N-1 << endl; }