#include int main() { using namespace std; unsigned long N; cin >> N; vector A{0, 1, 10000}; const auto query{[](auto i, auto j) -> bool { if(i == 0)return true; if(i == 10000)return false; cout << "? " << i << " " << j << endl; unsigned long t; cin >> t; return t; }}; for(unsigned long i{2}; i <= N; ++i){ unsigned long l{0}, r{size(A) + 1}; while(l + 1 < r){ auto m{(l + r) / 2}; (query(A[m], i) ? l : r) = m; } A.insert(begin(A) + l + 1, i); } A.pop_back(); A.erase(begin(A)); cout << "!" << endl; cout << N - 1 << endl; for(const auto a : A)cout << a << " "; cout << endl; return 0; }