#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  cin >> n;
  vector<long long> ar(n + 1, -1);
  function<long long(long long, long long)> query = [&](long long i,
                                                        long long j) {
    cout << "? " << i << ' ' << j << endl;
    long long a, b;
    cin >> a;
    cout << "? " << j << ' ' << i << endl;
    cin >> b;
    if (a > b)
      ar[i] = a;
    else
      ar[j] = b;
    return max(pair<long long, long long>{a, j},
               pair<long long, long long>{b, i})
        .second;
  };
  long long pt = 1;
  for (long long i = 2; i <= n; i++) {
    pt = query(pt, i);
  }
  if (pt != 1) pt = query(1, pt);
  ar[pt] = n;
  ar.erase(ar.begin());
  cout << "! ";
  for (auto i : ar) cout << i << ' ';
  cout << endl;
  return 0;
}
