#define rep(i,n) for(int (i)=0;(i)<(n);(i)++) typedef long long ll; #include using namespace std; template void Fill(A (&array)[N], const T &val){ std::fill( (T*)array, (T*)(array+N), val ); } int main() { ll n; std::cin >> n; // トーナメントを行って1位と戦って負けたやつの中で一番強いやつ vector next; for (int i = 1; i <= n; i++) { next.push_back(i); } vector list[400]; while(next.size()!=1){ vector next_next; for (int i = 0; i < next.size()/2; i++) { std::cout << "? "<> tmp; next_next.push_back(tmp); } if(next.size()%2==1){ ll a,b; a = next_next[next_next.size()-1]; next_next.erase(next_next.begin()+next_next.size()-1); b = next[next.size()-1]; list[a].push_back(b); list[b].push_back(a); std::cout << "? "<> tmp; next_next.push_back(tmp); } next.clear(); for (auto e : next_next) { next.push_back(e); } } ll win = next[0]; ll now = list[win][0]; for (int i = 1; i < list[win].size(); i++) { std::cout << "? "<> tmp; now = tmp; } std::cout << "! "<