#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; using Pll = pair; using Pii = pair; constexpr ll MOD = 1000000007; constexpr long double EPS = 1e-10; constexpr int dyx[4][2] = { { 0, 1}, {-1, 0}, {0,-1}, {1, 0} }; int main() { int n, winner; cin >> n; vector v(2, -1); vector lose(n+1, -1); v[0] = 1; for(int i=2;i<=n;++i) { cout << "? " << v[0] << ' ' << i << endl; cin >> winner; if(winner == i) { lose[v[0]] = i; v[0] = i; } else { lose[i] = v[0]; } } vector cand; for(int i=1;i<=n;++i) { if(lose[i] == v[0]) { cand.push_back(i); } } v[1] = cand[0]; for(int i=1;i> winner; if(winner == cand[i]) { v[1] = cand[i]; } } cout << "! " << v[1] << endl; }