#include <bits/stdc++.h>
using namespace std;
int ask(int i, int j) {
  cout << "? " << i + 1 << ' ' << j + 1 << '\n';
  cout.flush();
  int x;
  cin >> x;
  return x;
}
int mk[3000];
int main() {
  srand(time(0));
  int n;
  cin >> n;
  int pos = 0;
  int act = 1;
  while (act < n) {
    int x = ask(pos, act);
    while (act < n && !mk[x]) {
      mk[x] = act;
      act++;
      if (act < n) x = ask(pos, act);
    }
    if (act == n) break;
    pos = -1;
    int vi = -1;
    for (int i = 0; i < 3000; i++)
      if (mk[i]) {
        if (pos == -1) {
          pos = mk[i];
          vi = i;
        }
        mk[i] = 0;
      }
    if (vi == x) mk[ask(pos, act)] = act;
    act++;
  }
  int p1 = pos;
  int p2 = -1;
  for (int i = 0; i < 3000; i++)
    if (mk[i] && p2 == -1) p2 = mk[i];
  int p0 = -1;
  if (p2 == -1) p0 = pos;
  while (p0 == -1) {
    int p3 = (rand() % n);
    while (p3 == p1 || p3 == p2) p3 = (rand() % n);
    int x1 = ask(p1, p3);
    int x2 = ask(p2, p3);
    if (x1 < x2) p0 = p1;
    if (x2 < x1) p0 = p2;
  }
  vector<int> res(n);
  res[p0] = 0;
  for (int i = 0; i < n; i++)
    if (i != p0) res[i] = ask(i, p0);
  cout << "!";
  for (int i = 0; i < n; i++) cout << ' ' << res[i];
  cout << '\n';
  cout.flush();
  return 0;
}
