#include <bits/stdc++.h>
using namespace std;
int q(int a, int b) {
  cout << "? " << a << " " << b << '\n';
  cout.flush();
  int temp;
  cin >> temp;
  return temp;
}
void solve() {
  int n;
  cin >> n;
  vector<int> ans(n, 0);
  set<int> ind, val;
  for (int i = 1; i <= n; i++) {
    ind.insert(i);
    val.insert(i);
  }
  while (ind.size() >= 2) {
    int u, v;
    u = *ind.begin();
    ind.erase(u);
    v = *ind.begin();
    ind.erase(v);
    int a = q(u, v);
    int b = q(v, u);
    if (a > b) {
      ans[u] = a;
      ind.insert(v);
      val.erase(a);
    } else {
      ans[v] = b;
      ind.insert(u);
      val.erase(b);
    }
  }
  ans[*ind.begin()] = *val.begin();
  cout << "! ";
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int testcase;
  testcase = 1;
  for (int i = 0; i < testcase; i++) {
    solve();
  }
  return 0;
}
