#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const int MAX = 100005;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> v(n + 1, 0);
  set<long long int> s;
  for (int i = 1; i <= n; i++) s.insert(i);
  long long int q = n - 1;
  long long int cn = 0;
  long long int i = 1, j = 2;
  while (q-- && i <= n && j <= n) {
    long long int v1, v2;
    cout << "? " << i << " " << j << endl;
    cout.flush();
    cin >> v1;
    cout << "? " << j << " " << i << endl;
    cout.flush();
    cin >> v2;
    if (v1 > v2) {
      v[i] = v1;
      s.erase(s.find(v1));
      i = max(i, j) + 1;
    } else {
      v[j] = v2;
      s.erase(s.find(v2));
      j = max(i, j) + 1;
    }
  }
  for (i = 1; i <= n; i++) {
    if (v[i] == 0) v[i] = *s.begin();
  }
  cout << "! ";
  cout.flush();
  for (i = 1; i < n + 1; i++) {
    cout << v[i] << " ";
    cout.flush();
  }
  cout << endl;
  return 0;
}
