#include <bits/stdc++.h>
using namespace std;
long long dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> ans(n + 1);
    long long i = 1, j = 2, nxt = 3;
    map<long long, long long> m;
    int turn = n - 1;
    while (turn--) {
      long long a, b;
      cout << "? " << i << " " << j << endl;
      cin >> a;
      cout << "? " << j << " " << i << endl;
      cin >> b;
      if (a > b) {
        ans[i] = a;
        m[a] = 1;
        i = nxt;
        nxt++;
      } else {
        ans[j] = b;
        m[b] = 1;
        j = nxt;
        nxt++;
      }
    }
    int idx = min(i, j);
    for (long long i = 1; i <= n; i++) {
      if (m[i] == 0) {
        ans[idx] = i;
        break;
      }
    }
    cout << "! ";
    for (long long i = 1; i <= n; i++) cout << ans[i] << " ";
    cout << "\n";
    ;
  }
  return 0;
}
