#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, x, y;
  cin >> n;
  vector<long long int> count(n + 1);
  vector<long long int> ans(n + 1);
  long long int j = 1;
  for (long long int i = 1; i < n; ++i) {
    cout << "? " << j << " " << i + 1 << endl;
    fflush(stdout);
    cin >> x;
    if (x == -1) break;
    cout << "? " << i + 1 << " " << j << endl;
    fflush(stdout);
    cin >> y;
    if (y == -1) break;
    if (x > y) {
      ans[j] = x;
      count[x] = 1;
      j = i + 1;
    } else {
      ans[i + 1] = y;
      count[y] = 1;
    }
  }
  for (long long int i = 1; i <= n; ++i) {
    if (count[i] == 0) {
      ans[j] = i;
      break;
    }
  }
  cout << "! ";
  for (long long int i = 1; i <= n; ++i) {
    cout << ans[i] << " ";
    fflush(stdout);
  }
  return 0;
}
