/** author: shobonvip created: 2026.07.17 21:27:14 **/ #include using namespace std; //* ATCODER #include using namespace atcoder; typedef modint998244353 mint; //*/ /* BOOST MULTIPRECISION #include using namespace boost::multiprecision; //*/ typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) #define all(v) v.begin(), v.end() template bool chmin(T &a, const T &b) { if (a <= b) return false; a = b; return true; } template bool chmax(T &a, const T &b) { if (a >= b) return false; a = b; return true; } template T max(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]); return ret; } template T min(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]); return ret; } template T sum(vector &a){ T ret = 0; for (int i=0; i<(int)a.size(); i++) ret += a[i]; return ret; } ll op(ll a, ll b) { return a + b; } ll e() { return 0LL; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; auto ask = [&](int l, int r) -> ll { cout << '?' << ' ' << l + 1 << ' ' << r << endl; ll x; cin >> x; return x; }; auto answer = [&](vector p) -> void { cout << "!"; rep(i,0,n) { cout << ' ' << p[i] + 1; } cout << endl; return; }; ll now = ask(0, n); segtree seg(vector(n,1LL)); ll y; auto f = [&](ll x) -> ll { return x <= y; }; vector ans(n); rep(i,0,n-1) { ll vt = ask(i+1, n); y = now - vt; int rt = seg.max_right(0, f); seg.set(rt, 0); ans[i] = rt; now = vt; } y = 0; ans[n-1] = seg.max_right(0, f); answer(ans); }