#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265358979323846;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int i = 1, j = 2, done = 0;
  vector<int> vec(n, 0);
  while (done < n - 1) {
    int i_mod_j, j_mod_i;
    cout << "? " << i << " " << j << endl;
    fflush(stdout);
    cin >> i_mod_j;
    cout << "? " << j << " " << i << endl;
    fflush(stdout);
    cin >> j_mod_i;
    if (i_mod_j > j_mod_i) {
      vec[i - 1] = i_mod_j;
      i = max(i, j) + 1;
    } else {
      vec[j - 1] = j_mod_i;
      j = max(i, j) + 1;
    }
    done++;
  }
  vec[min(i, j) - 1] = n;
  cout << "! ";
  for (int i = 0; i < n; i++) cout << vec[i] << ' ';
  fflush(stdout);
  return 0;
}
