#include <bits/stdc++.h>
#pragma GCC optimize("-Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-funroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
const int N = 3e5 + 7, mod = 1e9 + 7;
const int inf = N;
int n;
int ans[N];
int ask(int i, int j) {
  cout << "? " << i << " " << j << endl;
  cout << flush;
  int ret;
  cin >> ret;
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  set<int> s;
  for (int i = 1; i <= n; i++) s.insert(i);
  vector<int> v = {1};
  for (int i = 2; i <= n; i++) {
    int prv = v.back();
    int a1 = ask(prv, i);
    int a2 = ask(i, prv);
    if (a1 > a2) {
      ans[prv] = a1;
      v.pop_back();
      v.push_back(i);
    } else {
      ans[i] = a2;
    }
  }
  for (int i = 1; i <= n; i++) s.erase(ans[i]);
  for (int i = 1; i <= n; i++)
    if (ans[i] == 0) {
      ans[i] = (*s.begin());
    }
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
  cout << flush;
  return 0;
}
