#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int x = 0, cf = 1;
  while (ch < '0' || ch > '9') {
    if (ch == '-') cf = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  if (cf < 0)
    return -x;
  else
    return x;
}
int G[55];
template <class T>
inline void write(T x) {
  int g = 0;
  do {
    G[++g] = x % 10;
    x /= 10;
  } while (x);
  for (int i = g; i >= 1; --i) putchar('0' + G[i]);
  putchar('\n');
}
int ans[100010];
int a[100010];
int main() {
  int n;
  cin >> n;
  int mx = 1;
  for (int i = 2; i <= n; i++) {
    cout << "? " << i << " " << mx << endl;
    cout.flush();
    int qwq;
    cin >> qwq;
    cout << "? " << mx << " " << i << endl;
    cout.flush();
    int qaq;
    cin >> qaq;
    if (qwq < qaq) {
      ans[mx] = qaq;
      mx = i;
    } else {
      ans[i] = qwq;
    }
  }
  ans[mx] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  return 0;
  cout << "UUZ ate it." << endl;
}
