#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
const long long MOD = 1e9 + 7;
const long long INF = LLONG_MAX;
const long long SIZE = 100000;
void solve() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  long long mx = 0;
  for (long long i = 1; i < (long long)n; i++) {
    cout << "? " << mx + 1 << " " << i + 1 << endl;
    cout.flush();
    long long a, b;
    cin >> a;
    cout << "? " << i + 1 << " " << mx + 1 << endl;
    cout.flush();
    cin >> b;
    if (a > b) {
      v[mx] = a;
      mx = i;
    } else {
      v[i] = b;
    }
  }
  v[mx] = n;
  cout << "! ";
  for (auto x : v) cout << x << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
