#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int32_t main() {
  long long n;
  cin >> n;
  vector<bool> used(n);
  vector<long long> p(n, 0);
  set<long long> val;
  for (long long i = 0; i < n; i++) val.insert(i);
  for (long long i = 0; i < n; i++) {
    if (val.size() >= 2) {
      long long t = *val.begin();
      val.erase(val.begin());
      long long q = *val.begin();
      val.erase(val.begin());
      long long x1, x2;
      cout << "? " << q + 1 << " " << t + 1 << '\n';
      cin >> x1;
      cout << "? " << t + 1 << " " << q + 1 << '\n';
      cin >> x2;
      assert(x1 != x2);
      if (x1 > x2) {
        p[q] = x1;
        val.insert(t);
      } else {
        p[t] = x2;
        val.insert(q);
      }
    } else {
      long long sm = n * (n + 1) / 2;
      for (long long i = 0; i < n; i++) sm -= p[i];
      long long q = *val.begin();
      p[q] = sm;
    }
  }
  cout << "! ";
  for (auto el : p) {
    cout << el << " ";
  }
  cout << '\n';
  return 0;
}
