#include <bits/stdc++.h>
using namespace std;
bool myComp(pair<int, int> p1, pair<int, int> p2) {
  return p1.second < p2.second;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> ans;
  stack<int> s;
  for (int i = 0; i < n; ++i) s.push(i + 1);
  for (int i = 0; i < 2 * n; ++i) {
    if (s.size() == 1) break;
    int a = s.top();
    s.pop();
    int b = s.top();
    s.pop();
    int m, nn;
    cout << "? " << a << " " << b << endl;
    cin >> m;
    cout << "? " << b << " " << a << endl;
    cin >> nn;
    if (m >= nn) {
      ans.push_back({m, a});
      s.push(b);
    } else {
      ans.push_back({nn, b});
      s.push(a);
    }
  }
  ans.push_back({n, s.top()});
  sort(ans.begin(), ans.end(), myComp);
  cout << "! ";
  for (int i = 0; i < n; ++i) {
    cout << ans[i].first << " ";
  }
  cout << endl;
  return 0;
}
