#include <bits/stdc++.h>
using namespace std;
mt19937 __MT(chrono::system_clock::now().time_since_epoch().count());
const int maxn = (1 << 11) + 10;
const long long mod = 998244353;
int n;
int p[maxn];
int bits[maxn];
int cnt = 4296;
int vis[maxn][maxn];
int Log;
inline int query(int x, int y) {
  if (vis[x][y] >= 0) return vis[x][y];
  assert(--cnt >= 0);
  fflush(stdout);
  printf("? %d %d\n", x, y);
  fflush(stdout);
  int res;
  scanf("%d", &res);
  vis[x][y] = vis[y][x] = res;
  fflush(stdout);
  return res;
}
inline void answer() {
  fflush(stdout);
  printf("!");
  for (auto i = (1); i <= (n); ++i) printf(" %d", p[i]);
  puts("");
  fflush(stdout);
}
inline void init() {
  int done = 0;
  Log = 0;
  for (Log; (1 << Log) <= n; Log++)
    ;
  Log--;
  for (; done <= Log;) {
    int x, y;
    x = __MT() % n + 1;
    y = __MT() % n + 1;
    if (vis[x][y] >= 0 || x == y) continue;
    int res = query(x, y);
    vis[x][y] = vis[y][x] = res;
    for (auto i = (0); i <= (Log); ++i) {
      if ((1 << i) & res)
        continue;
      else {
        if (bits[i] == 0) {
          done++;
          bits[i] = x;
        }
      }
    }
  }
}
inline int brute(int id) {
  int ans = 0;
  for (auto i = (0); i <= (Log); ++i) {
    int res;
    if (id != bits[i])
      res = query(bits[i], id);
    else
      res = 0;
    if ((res >> i) & 1) ans |= (1 << i);
  }
  return ans;
}
inline void solve() {
  int idx = 1;
  int val = brute(idx);
  p[1] = val;
  for (auto i = (2); i <= (n); ++i) {
    assert(idx != i);
    int res;
    if (vis[i][idx] >= 0)
      res = vis[i][idx];
    else
      res = query(i, idx);
    if (res != val) {
      assert(res > val);
      continue;
    }
    for (auto j = (0); j <= (Log); ++j) {
      if ((1 << j) & val) {
        if (i == bits[j]) {
          val ^= (1 << j);
          continue;
        }
        int tmp;
        tmp = query(i, bits[j]);
        if ((tmp >> j) & 1)
          continue;
        else
          val ^= (1 << j);
      }
    }
    idx = i;
  }
  assert(val == 0);
  for (auto i = (2); i <= (n); ++i) {
    if (i != idx)
      p[i] = query(i, idx);
    else
      p[i] = 0;
  }
  answer();
}
int main(void) {
  memset(vis, -1, sizeof(vis));
  scanf("%d", &(n));
  init();
  solve();
  return 0;
}
