#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n, -1);
  auto ask = [&](int i, int j) {
    cout << "? " << i + 1 << " " << j + 1 << endl;
    int k;
    cin >> k;
    return k;
  };
  priority_queue<int> sisa;
  for (int i = 0; i < n; ++i) {
    sisa.push(i);
  }
  while (sisa.size() > 1U) {
    int i = sisa.top();
    sisa.pop();
    int j = sisa.top();
    sisa.pop();
    int one = ask(i, j);
    int two = ask(j, i);
    if (one > two) {
      a[i] = one;
      sisa.push(j);
    } else if (two > one) {
      a[j] = two;
      sisa.push(i);
    } else {
      assert(false);
    }
  }
  a[sisa.top()] = n;
  cout << "!";
  for (int i = 0; i < n; ++i) {
    cout << " " << a[i];
  }
  cout << endl;
  return 0;
}
