#include <bits/stdc++.h>
using namespace std;
const int mxn = 1e4 + 3;
int n;
int a[mxn];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  int mx = 1;
  while (true) {
    for (int i = 1; i <= n; i++)
      if (!a[i] && i != mx) {
        cout << "? " << mx << " " << i << endl;
        int x, y;
        cin >> x;
        cout << "? " << i << " " << mx << endl;
        cin >> y;
        if (x > y) {
          a[mx] = x;
          mx = i;
        } else {
          a[i] = y;
        }
      }
    int ok = 0;
    for (int i = 1; i <= n; i++)
      if (!a[i]) {
        ok++;
      }
    if (ok == 1) {
      cout << "! ";
      for (int i = 1; i <= n; i++)
        if (a[i] != 0)
          cout << a[i] << " ";
        else
          cout << n << " ";
      cout << endl;
      return 0;
    }
  }
  return 0;
}
