#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> apr(n + 1), arr(n);
  long long now = 1, next = 2;
  for (long long i = 0; i < n - 1; i++, next++) {
    long long a = 0, b = 0;
    cout << "? " << now << ' ' << next << '\n';
    cout.flush();
    cin >> a;
    cout << "? " << next << ' ' << now << '\n';
    cout.flush();
    cin >> b;
    if (a > b) {
      arr[now - 1] = a;
      apr[a] = 1;
      now = next;
    } else {
      arr[next - 1] = b;
      apr[b] = 1;
    }
  }
  for (long long i = 1; i <= n; i++) {
    if (apr[i] == false) {
      arr[now - 1] = i;
      break;
    }
  }
  cout << "! ";
  for (long long i = 0; i < n; i++) {
    cout << arr[i] << ' ';
  }
  cout << '\n';
  cout.flush();
}
