#include #include using namespace std; using namespace atcoder; #define ll long long #define rep(i,n) for (int i = 0; i < (n); i++) #define coutf(f) cout << fixed << setprecision(f) #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() int main() { int n; cin >> n; if (n % 2 == 0) { int x = 0, y = 1; rep(i, n / 2) { int z; cout << "? " << x << " " << y << endl; cin >> z; if (z == x) { cout << "! " << y << endl; return 0; } else if (z == y) { cout << "! " << x << endl; return 0; } x += 2; y += 2; } } else { int x = 0, y = 1; rep(i, n / 2) { int z; cout << "? " << x << " " << y << endl; cin >> z; if (z == x) { cout << "! " << y << endl; return 0; } else if (z == y) { cout << "! " << x << endl; return 0; } x += 2; y += 2; } cout << "! " << n - 1 << endl; } return 0; }