#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e6 + 10;
const int inf = 1e9;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n;
  cin >> n;
  auto ask = [&](int i, int j) {
    cout << "? " << i + 1 << " " << j + 1 << endl;
    int x;
    cin >> x;
    return x;
  };
  vector<int> ans(n);
  set<int> hz;
  for (int i = 0; i < n; i++) hz.insert(i);
  while (hz.size() > 1) {
    auto i1 = *hz.begin();
    hz.erase(i1);
    auto i2 = *hz.begin();
    hz.erase(i2);
    int x1 = ask(i1, i2);
    int x2 = ask(i2, i1);
    if (x1 > x2) {
      ans[i1] = x1;
      hz.insert(i2);
    } else {
      ans[i2] = x2;
      hz.insert(i1);
    }
  }
  ans[*hz.begin()] = n * (n + 1) / 2 - accumulate(ans.begin(), ans.end(), 0);
  cout << "!"
       << " ";
  for (auto x : ans) cout << x << " ";
  cout << endl;
}
