#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const int inf = 99999999;
int a[10007];
void print(int q, int w) { cout << "? " << q << " " << w << '\n'; }
int main() {
  int n;
  scanf("%d", &n);
  int last = 1;
  for (int i = 2; i <= n; i++) {
    int q, w;
    print(last, i);
    fflush(stdout);
    cin >> q;
    print(i, last);
    fflush(stdout);
    cin >> w;
    if (q < w)
      a[i] = w;
    else
      a[last] = q, last = i;
  }
  a[last] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  fflush(stdout);
}
