#include <bits/stdc++.h>
using namespace std;
int n;
int zero[20];
int P[5000];
int pytaj(int a, int b) {
  cout << "? " << a << " " << b << "\n";
  cout.flush();
  int ans;
  cin >> ans;
  return ans;
}
int poznaj(int nr) {
  int l = 0;
  for (int i = 0; i <= 11; i++) {
    if (zero[i] != nr) {
      int ans = pytaj(nr, zero[i]);
      if ((ans & (1 << i)) != 0) {
        l += (1 << i);
      }
    }
  }
  return l;
}
int main() {
  srand(1995);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    P[i] = -1;
  }
  for (int i = 0; i <= 11; i++) {
    zero[i] = -1;
  }
  int ile_bitow = 0;
  while (ile_bitow < 12) {
    int a = 1 + rand() % n;
    int b = 1 + rand() % n;
    while (a == b) b = 1 + rand() % n;
    int ans = pytaj(a, b);
    for (int i = 0; i <= 11; i++) {
      if (zero[i] == -1 && (ans & (1 << i)) == 0) {
        zero[i] = a;
        ile_bitow++;
      }
    }
  }
  P[1] = poznaj(1);
  int best = P[1];
  int best_nr = 1;
  for (int i = 2; best > 0 && i <= n; i++) {
    int ans = pytaj(best_nr, i);
    if (ans == best) {
      best = poznaj(i);
      P[i] = best;
      best_nr = i;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (P[i] == -1) {
      int ans = pytaj(best_nr, i);
      P[i] = ans;
    }
  }
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << P[i] << " ";
  cout << "\n";
  cout.flush();
  return 0;
}
