#include <bits/stdc++.h>
using namespace std;
const int N = 2100;
int a[N], n, b[N];
int qry(int x, int y) {
  printf("? %d %d\n", x, y);
  fflush(stdout);
  int z;
  scanf("%d", &z);
  return z;
}
int main() {
  srand(521092156);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) b[i] = i;
  random_shuffle(b + 1, b + n + 1);
  int x = b[1], y = b[2], v = qry(x, y), z, vv;
  for (int i = 3; i <= n; i++) {
    z = b[i];
    vv = qry(y, z);
    if (v > vv)
      x = z, v = vv;
    else if (v == vv)
      y = z, v = qry(x, y);
  }
  random_shuffle(b + 1, b + n + 1);
  int p0;
  for (int i = 1; i <= n; i++) {
    z = b[i];
    if (z == x || z == y) continue;
    int v1 = qry(x, z), v2 = qry(y, z);
    if (v1 < v2) {
      p0 = x;
      break;
    } else if (v1 > v2) {
      p0 = y;
      break;
    }
  }
  for (int i = 1; i <= n; i++)
    if (i ^ p0) a[i] = qry(p0, i);
  printf("!");
  for (int i = 1; i <= n; i++) printf(" %d", a[i]);
  printf("\n");
}
