#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> ans(n);
  set<long long> can;
  for (long long i = 0; i < n; ++i) {
    can.insert(i);
  }
  for (long long _ = 0; _ < n - 1; ++_) {
    auto it = can.begin();
    long long i = *it;
    ++it;
    long long j = *it;
    long long ans1, ans2;
    cout << "? " << i + 1 << " " << j + 1 << endl;
    cin >> ans1;
    cout << "? " << j + 1 << " " << i + 1 << endl;
    cin >> ans2;
    if (ans1 > ans2) {
      ans[i] = ans1;
      can.erase(i);
    } else {
      ans[j] = ans2;
      can.erase(j);
    }
  }
  cout << "!";
  ans[*can.begin()] = n;
  for (auto i : ans) {
    cout << " " << i;
  }
}
