#include <bits/stdc++.h>
using namespace std;
string repeat(string second, int n) {
  string s1 = "";
  for (int i = 0; i < n; i++) s1 += second;
  return s1;
}
string getString(char x) {
  string second(1, x);
  return second;
}
void optimizeIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void solve() {
  int n;
  cin >> n;
  int temp = 1;
  int a[n + 1];
  for (int i = 2; i < n + 1; i++) {
    int x, y;
    cout << "? " << temp << " " << i << endl;
    cin >> x;
    cout << "? " << i << " " << temp << endl;
    cin >> y;
    if (x > y) {
      a[temp] = x;
      temp = i;
    } else {
      a[i] = y;
    }
  }
  a[temp] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << a[i] << " ";
  cout << endl;
}
int main() {
  optimizeIO();
  { solve(); }
}
