#include <bits/stdc++.h>
using namespace std;
long long n, x, y, mod, d = 1, a[10009];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    cout << "? " << d << " " << i << endl;
    cin >> x;
    cout << "? " << i << " " << d << endl;
    cin >> y;
    if (x > y)
      a[d] = x, d = i;
    else
      a[i] = y;
  }
  cout << "! ";
  for (long long i = 1; i <= n; i++) {
    if (a[i])
      cout << a[i] << " ";
    else
      cout << n << " ";
  }
  return 0;
}
