#include <bits/stdc++.h>
using namespace std;
int a[100010];
int b[100010 * 2];
bool vis[100010];
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("! 1");
    return 0;
  }
  int t1 = 1;
  int t2 = 2;
  int num = 0;
  for (int i = 1; i <= n; ++i) {
    printf("? %d %d\n", t1, t2);
    fflush(stdout);
    scanf("%d", &b[num + 1]);
    num++;
    printf("? %d %d\n", t2, t1);
    fflush(stdout);
    scanf("%d", &b[num + 1]);
    num++;
    if (b[num] > b[num - 1]) {
      a[t2] = b[num];
      vis[a[t2]] = 1;
      t2++;
    } else {
      a[t1] = b[num - 1];
      vis[a[t1]] = 1;
      t1 = t2;
      t2++;
    }
    if (t2 > n) {
      for (int j = 1; j <= n; ++j) {
        if (!vis[j]) {
          a[t1] = j;
          break;
        }
      }
      break;
    }
  }
  printf("!");
  for (int i = 1; i <= n; ++i) {
    printf(" %d", a[i]);
  }
  return 0;
}
