#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
void solve() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << "! 1";
    return;
  }
  vector<int> v(n + 1);
  int fir = 1, sec = 2;
  while (1) {
    int x, y;
    printf("? %d %d\n", fir, sec);
    fflush(stdout);
    scanf("%d", &x);
    printf("? %d %d\n", sec, fir);
    fflush(stdout);
    scanf("%d", &y);
    if (x > y) {
      v[fir] = x;
      fir = max(fir, sec) + 1;
    } else {
      v[sec] = y;
      sec = max(fir, sec) + 1;
    }
    if (fir > n) {
      v[sec] = n;
      break;
    }
    if (sec > n) {
      v[fir] = n;
      break;
    }
  }
  printf("!");
  for (int i = 1; i <= n; i++) printf(" %d", v[i]);
  cout << endl;
}
int main() {
  solve();
  return 0;
}
