#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long count = 1;
  long long x, y, r = 1, s = 2;
  long long a[n];
  bool visi[n + 1];
  for (long long i = 1; i <= n; i++) {
    visi[i] = false;
    a[i - 1] = 0;
  }
  while (count < n) {
    count++;
    cout << "? " << r << " " << s << endl;
    cin >> x;
    cout << "? " << s << " " << r << endl;
    cin >> y;
    if (x > y) {
      a[r - 1] = x;
      visi[x] = true;
      r = s;
      s = s + 1;
    } else {
      a[s - 1] = y;
      visi[y] = true;
      s = s + 1;
    }
  }
  cout << "!"
       << " ";
  long long o;
  for (long long i = 1; i <= n; i++) {
    if (visi[i] == false) {
      o = i;
      break;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] == 0) {
      a[i] = o;
    }
  }
  for (long long i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
}
