#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
void input() {}
void solve() {
  long long int n;
  cin >> n;
  long long int ans[n + 1];
  memset(ans, 0, sizeof(ans));
  set<long long int> s, k;
  for (long long int i = 1; i < n + 1; i++) {
    s.insert(i);
    k.insert(i);
  }
  long long int x = 1, y = 2;
  for (long long int i = 0; i < n - 1; i++) {
    long long int p, q;
    long long int x = *s.begin();
    s.erase(x);
    long long int y = *s.begin();
    s.erase(y);
    cout << "? " << x << " " << y << endl;
    fflush(stdout);
    cin >> p;
    cout << "? " << y << " " << x << endl;
    fflush(stdout);
    cin >> q;
    if (p > q) {
      ans[x] = p;
      s.insert(y);
      k.erase(p);
    } else {
      ans[y] = q;
      s.insert(x);
      k.erase(q);
    }
  }
  ans[*s.begin()] = *k.begin();
  cout << "! ";
  for (long long int i = 1; i < n + 1; i++) {
    cout << ans[i] << " ";
  }
  cout << endl;
  fflush(stdout);
  long long int temp;
  cin >> temp;
  if (temp == -1) {
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  input();
  long long int x = 1;
  int t = 1, i = 1;
  while (t--) {
    solve();
    cout << endl;
  }
}
