#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> ans(n + 1, -1);
  int mxidx = 1;
  for (int i = 1; i <= n; i++) {
    if (i == mxidx) continue;
    cout << "? " << i << " " << mxidx << endl;
    int x;
    cin >> x;
    cout << "? " << mxidx << " " << i << endl;
    int y;
    cin >> y;
    if (x > y)
      ans[i] = x;
    else {
      ans[mxidx] = y;
      mxidx = i;
    }
  }
  ans[mxidx] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << endl;
  return 0;
}
