#include <bits/stdc++.h>
using namespace std;
long long const mod = 1e9 + 7;
long long const long_max = LONG_LONG_MAX;
int interact(int i, int j) {
  cout << "? " << i + 1 << ' ' << j + 1 << "\n";
  ;
  cout.flush();
  int x;
  cin >> x;
  return x;
}
void solve() {
  int n;
  cin >> n;
  int ind = 0;
  vector<int> b(n);
  for (int i = 1; i < n; i++) {
    int x = interact(ind, i);
    int y = interact(i, ind);
    if (x < y) {
      b[i] = y;
    } else {
      b[ind] = x;
      ind = i;
    }
  }
  b[ind] = n;
  cout << "! ";
  for (auto i : b) cout << i << " ";
  cout << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1, p;
  p = t;
  t = 1;
  while (p--) {
    solve();
    t++;
  }
  return 0;
}
