#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 2;
const long long mod = 1e9 + 7;
int n;
int interact(int x, int y) {
  cout << "? " << x << " " << y << endl;
  int res;
  cin >> res;
  cout << endl;
  return res;
}
int main() {
  cin >> n;
  int mx = -1, pos = -1;
  int ans[n + 1];
  memset(ans, -1, sizeof(ans));
  map<int, int> vis;
  int j = 1;
  for (int i = 2; i <= n; i++) {
    int k = mx;
    int l = interact(j, i), r = interact(i, j);
    if (l > r) {
      ans[j] = l;
      j = i;
    } else {
      ans[i] = r;
    }
  }
  for (long long i = 1; i < n + 1; i++) {
    if (ans[i] != -1) vis[ans[i]]++;
  }
  int x;
  for (long long i = 1; i < n + 1; i++) {
    if (!vis[i]) {
      x = i;
      break;
    }
  }
  cout << "! ";
  for (long long i = 1; i < n + 1; i++) {
    if (ans[i] != -1)
      cout << ans[i] << " ";
    else
      cout << x << " ";
  }
  cout << endl;
  int ver;
  cin >> ver;
}
