#include <bits/stdc++.h>
const long long INF = 1000000001;
const long double E = 0.00000001;
using namespace std;
signed main() {
  long long n, w, w1;
  cin >> n;
  vector<long long> a(n + 1, -1), s(n + 1, 0);
  long long q1 = 1;
  for (long long q = 2; q <= n; q++) {
    cout << "? " << q1 << ' ' << q << endl;
    cin >> w;
    cout << "? " << q << ' ' << q1 << endl;
    cin >> w1;
    if (w > w1) {
      s[w] = 1;
      a[q1] = w;
      q1 = q;
    } else {
      s[w1] = 1;
      a[q] = w1;
    }
  }
  for (long long q = 1; q <= n; q++) {
    if (s[q] == 0) {
      a[q1] = q;
    }
  }
  cout << "! ";
  for (long long q = 1; q <= n; q++) {
    cout << a[q] << ' ';
  }
  cout << endl;
  return 0;
}
