#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int st;
  srand(time(NULL));
  while (true) {
    int first = rand() % n + 1;
    int second = rand() % n + 1;
    while (second == first) second = rand() % n + 1;
    printf("? %d %d\n", first, second);
    fflush(stdout);
    int a;
    scanf("%d", &a);
    if (__builtin_popcount(a) < 8) {
      st = first;
      break;
    }
  }
  vector<int> v;
  int Min = 1e9;
  for (int i = 1; i <= n; i++) {
    if (i != st) v.push_back(i);
  }
  while (true) {
    vector<int> v2;
    int first = (1 << 20) - 1;
    for (auto it : v) {
      printf("? %d %d\n", it, st);
      fflush(stdout);
      int a;
      scanf("%d", &a);
      first &= a;
      if (a < Min) {
        Min = a;
        v2.clear();
      }
      if (a == Min) {
        v2.push_back(it);
      }
    }
    if (first == 0) {
      break;
    }
    if (v2.size() == 1) {
      st = v2.back();
      break;
    }
    st = v2.back();
    v2.pop_back();
    swap(v, v2);
  }
  int ans[3000];
  for (int i = 1; i <= n; i++) {
    if (st == i)
      ans[i] = 0;
    else {
      printf("? %d %d\n", i, st);
      fflush(stdout);
      scanf("%d", &ans[i]);
    }
  }
  printf("!");
  for (int i = 1; i <= n; i++) {
    printf(" %d", ans[i]);
  }
  printf("\n");
  fflush(stdout);
}
