#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const long long mod = 1e9 + 7;
inline long long bigmod(long long B, long long P) {
  long long R = 1;
  while (P > 0) {
    if (P & 1) {
      R = (R * B) % mod;
    }
    P >>= 1;
    B = (B * B) % mod;
  }
  return R;
}
const long long mxn = 2e5 + 10;
long long Mod(long long a) { return a % mod; }
long long Mul(long long a, long long b) { return Mod(Mod(a) * Mod(b)); }
long long Add(long long a, long long b) { return Mod(Mod(a) + Mod(b)); }
signed main() {
  long long n;
  cin >> n;
  long long op[n + 1];
  long long mx = 1, k1, k2;
  for (long long i = 2; i <= n; i++) {
    cout << "? " << mx << " " << i << '\n';
    cin >> k1;
    if (k1 == -1) return 0;
    cout << "? " << i << " " << mx << '\n';
    cin >> k2;
    if (k2 == -1) return 0;
    if (k1 > k2) {
      op[mx] = k1;
      mx = i;
    } else {
      op[i] = k2;
    }
  }
  op[mx] = n;
  cout << "! ";
  for (long long i = 1; i <= n; i++) cout << op[i] << ' ';
  cout << '\n';
  cout.flush();
  return 0;
}
