#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N == 1) {
    cout << "! 1" << endl;
    return 0;
  }
  vector<int> res(N);
  for (;;) {
    int x = 0, y = 0;
    for (int i = 0; i < N; ++i) {
      if (x == 0 && res[i] == 0) {
        x = i + 1;
      } else if (res[i] == 0) {
        y = i + 1;
        break;
      }
    }
    if (y == 0) break;
    int z, w;
    cout << "? " << x << " " << y << endl;
    cin >> z;
    cout << "? " << y << " " << x << endl;
    cin >> w;
    if (z == 0) {
      res[y - 1] = w;
    } else if (w == 0) {
      res[x - 1] = z;
    } else if (z > w) {
      res[x - 1] = z;
    } else {
      res[y - 1] = w;
    }
  }
  set<int> a;
  for (int i = 1; i <= N; ++i) a.insert(i);
  for (auto x : res) a.erase(x);
  for (auto& x : res)
    if (x == 0) x = *a.begin();
  cout << "!";
  for (auto x : res) cout << " " << x;
  cout << endl;
}
