#include <bits/stdc++.h>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
using ll = long long;
using ld = long double;
const ll MOD = 1e+9 + 7;
int f(int i, int j) {
  cout << "? " << i << ' ' << j << endl;
  int ans;
  cin >> ans;
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed;
  cout << setprecision(10);
  int n;
  cin >> n;
  int l = 1;
  int arr[n + 1];
  for (int i = 2; i <= n; i++) {
    int v1 = f(l, i);
    int v2 = f(i, l);
    if (v1 < v2)
      arr[i] = v2;
    else {
      arr[l] = v1;
      l = i;
    }
  }
  arr[l] = n;
  cout << "! ";
  for (int i = 1; i <= n; i++) cout << arr[i] << ' ';
}
