#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  set<int> quer;
  for (int i = 1; i <= n; i++) {
    quer.insert(i);
  }
  int x, y;
  int ans[n + 1];
  for (int i = 0; i <= n; i++) ans[i] = -1;
  while (quer.size() > 1) {
    x = *quer.begin();
    int fir, sec;
    quer.erase(x);
    if (quer.size() == 0) break;
    while (quer.size() >= 1) {
      int u = *quer.begin();
      if (u != x) {
        cout << "? " << x << " " << u << endl;
        cin >> fir;
        if (fir == -1) exit(0);
        cout << "? " << u << " " << x << endl;
        cin >> sec;
        if (sec == -1) exit(0);
        if (fir > sec) {
          ans[x] = fir;
          break;
        } else {
          ans[u] = sec;
          quer.erase(u);
        }
      }
      if (quer.size() == 0) break;
    }
  }
  cout << "! ";
  for (int i = 1; i <= n; i++) {
    if (ans[i] == -1)
      cout << n << " ";
    else
      cout << ans[i] << " ";
  }
  cout.flush();
  exit(0);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
