#include <bits/stdc++.h>
using namespace std;
long long fastpow(long long x, long long y) {
  if (y == 0) return 1;
  long long a = fastpow(x, y / 2);
  if (y & 1) {
    return (x * (a * a));
  }
  return (a * a);
}
void solve() {
  int n;
  cin >> n;
  int t = n;
  int ans[n + 1];
  memset(ans, 0, sizeof(ans));
  set<int> notfound;
  unordered_map<int, bool> present;
  for (int i = 1; i <= n; i++) {
    notfound.insert(i);
  }
  while (notfound.size() >= 2) {
    int a = *notfound.begin();
    notfound.erase(a);
    int b = *notfound.begin();
    notfound.erase(b);
    int ans1, ans2;
    cout << "? " << a << " " << b << endl;
    cin >> ans1;
    cout << "? " << b << " " << a << endl;
    cin >> ans2;
    if (ans1 > ans2) {
      ans[a] = ans1;
      present[ans[a]] = true;
      notfound.insert(b);
    } else {
      ans[b] = ans2;
      present[ans[b]] = true;
      notfound.insert(a);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (present[i] == false) {
      ans[*notfound.begin()] = i;
      break;
    }
  }
  cout << "! ";
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long q;
  q = 1;
  while (q--) {
    solve();
  }
  return 0;
}
