#include <bits/stdc++.h>
using namespace std;
int m[10005];
int ans[10005];
vector<int> q;
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    q.push_back(i);
  }
  while (q.size() > 1) {
    vector<int> temp;
    for (int i = 0; i + 1 < q.size(); i += 2) {
      int t1, t2;
      cout << "? " << q[i] << " " << q[i + 1] << endl;
      cout.flush();
      cin >> t1;
      cout << "? " << q[i + 1] << " " << q[i] << endl;
      cout.flush();
      cin >> t2;
      if (t1 < t2) {
        ans[q[i + 1]] = t2;
        temp.push_back(q[i]);
      } else {
        ans[q[i]] = t1;
        temp.push_back(q[i + 1]);
      }
    }
    if (q.size() % 2 == 1) {
      temp.push_back(q[q.size() - 1]);
    }
    q = temp;
  }
  ans[q[0]] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
}
