#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> p(n + 1);
  int x = 1, y = 2;
  int rs1, rs2;
  for (int i = 0; i < n - 1; i++) {
    cout << "? " << x << " " << y << "\n";
    fflush(stdout);
    cin >> rs1;
    cout << "? " << y << " " << x << "\n";
    fflush(stdout);
    cin >> rs2;
    if (rs1 > rs2) {
      p[x] = rs1;
      x = y;
      y++;
    } else {
      p[y] = rs2;
      y++;
    }
  }
  vector<bool> c(n + 1, false);
  for (int i = 1; i <= n; i++) c[p[i]] = true;
  int ind = -1;
  for (int i = 1; i <= n; i++)
    if (!c[i]) {
      ind = i;
      break;
    }
  for (int i = 1; i <= n; i++)
    if (p[i] == 0) {
      p[i] = ind;
      break;
    }
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << p[i] << " ";
  fflush(stdout);
}
int main() {
  int t = 1;
  while (t--) solve();
}
