#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int inf = 1e9;
int n, p[N], ans[N], s;
int MIN(int x, int y) { return x < y ? x : y; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) p[i] = i;
  random_shuffle(p + 1, p + n + 1);
  int x = p[1], y = p[2], now;
  printf("? %d %d\n", x, y);
  fflush(stdout);
  scanf("%d", &now);
  for (int i = 3; i <= n; i++) {
    printf("? %d %d\n", y, p[i]);
    fflush(stdout);
    int c;
    scanf("%d", &c);
    if (now > c)
      x = p[i], now = c;
    else if (c == now) {
      printf("? %d %d\n", x, y = p[i]);
      fflush(stdout);
      scanf("%d", &now);
    }
  }
  ans[x] = now, ans[y] = now;
  for (int i = 1; i <= n; i++)
    if (x != p[i] && y != p[i]) {
      int s1 = inf, s2 = inf;
      if (ans[y] == now) {
        printf("? %d %d\n", p[i], x);
        fflush(stdout);
        scanf("%d", &s1);
      }
      if (ans[x] == now) {
        printf("? %d %d\n", p[i], y);
        fflush(stdout);
        scanf("%d", &s2);
      }
      ans[p[i]] = MIN(s1, s2);
      if (s1 == s2) continue;
      if (s1 < s2)
        ans[x] = 0;
      else
        ans[y] = 0;
    }
  printf("! ");
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  fflush(stdout);
  return 0;
}
