#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); cout << "? 1 2" << endl; cin >> winner; if(winner == 1) { v[0] = 1; v[1] = 2; } else { v[0] = 2; v[1] = 1; } int cnt = 0; for(int i=3;i<=n;++i) { cout << "? " << v[1] << ' ' << i << endl; cin >> winner; if(winner == v[1]) { continue; } cout << "? " << v[0] << ' ' << i << endl; cin >> winner; if(winner == v[0]) { v[1] = i; } else { v[1] = v[0]; v[0] = i; } } cout << "! " << v[1] << endl; }