#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = 1000000001, INF = (ll)1e18 + 1;
void solve() {
  int n;
  cin >> n;
  vector<int> ans(n);
  queue<int> q;
  for (int i = 0; i < n; i++) q.push(i);
  vector<int> seen(n + 1, 0);
  while (q.size() > 1) {
    int i, j, a, b;
    i = q.front();
    q.pop();
    j = q.front();
    q.pop();
    cout << "? " << i + 1 << " " << j + 1 << endl;
    cout << endl;
    cout.flush();
    cin >> a;
    cout << "? " << j + 1 << " " << i + 1 << endl;
    cout << endl;
    cout.flush();
    cin >> b;
    if (a > b) {
      ans[i] = a;
      seen[a] = 1;
      q.push(j);
    } else {
      ans[j] = b;
      seen[b] = 1;
      q.push(i);
    }
  }
  for (int i = 1; i <= n; i++)
    if (!seen[i]) {
      ans[q.front()] = i;
      break;
    }
  cout << "! ";
  for (int i : ans) cout << i << " ";
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  solve();
  return 0;
}
