#include using namespace std; void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); } bool debug = true; int n; vector p, cum; int cnt = 0; int query(int l, int r) { cout << "? " << l << " " << r << endl; cnt++; if (debug) { return cum[r] - cum[l - 1]; } else { int res; cin >> res; return res; } } void answer(vector &a) { cout << "! "; for (int i = 0; i < a.size(); i++) { cout << a[i] << " "; } cout << endl; if (debug) { assert(a == p); assert(cnt < n); } } int main() { fast_io(); cin >> n; if (debug) { p.resize(n); iota(p.begin(), p.end(), 1); shuffle(p.begin(), p.end(), mt19937{random_device{}()}); cum.resize(n + 1); for (int i = 1; i <= n; i++) { cum[i] = cum[i - 1] + p[i - 1]; } } vector a(n); vector vis(n + 1); a[0] = n * (n + 1) / 2 - query(2, n); vis[a[0]] = true; for (int i = 1; i < n - 1; i++) { a[i] = query(i, i + 1) - a[i - 1]; vis[a[i]] = true; } for (int i = 1; i <= n; i++) { if (!vis[i]) { a[n - 1] = i; } } answer(a); }