#include <bits/stdc++.h>
using namespace std;
long long int n, k, a[10050], j;
int main() {
  cin >> n;
  k = 1;
  j = 1;
  for (int i = 2; i < n + 1; i++) {
    long long int x, y;
    cout << "? " << i << " " << k << endl;
    cin >> x;
    cout << "? " << k << " " << i << endl;
    cin >> y;
    if (x < y) {
      a[j] = y;
      k = i;
      j = i;
    } else {
      a[i] = x;
    }
  }
  a[k] = n;
  cout << "!" << '\n';
  for (int i = 1; i < n + 1; i++) {
    cout << a[i] << " ";
  }
}
