#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1000000;
void solve() {
  long long n;
  cin >> n;
  long long let = 0;
  vector<long long> vec(n);
  long long x, y;
  for (long long i = 1; i < n; ++i) {
    cout << "? " << let + 1 << " " << i + 1 << endl;
    cin >> x;
    cout << "? " << i + 1 << " " << let + 1 << endl;
    cin >> y;
    if (x < y)
      vec[i] = y;
    else {
      vec[let] = x;
      let = i;
    }
  }
  vec[let] = n;
  cout << "! ";
  for (auto i : vec) cout << i << " " << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) {
    solve();
  }
}
