#include <bits/stdc++.h>
using namespace std;
typedef long long int i64;
const i64 INF = 1e18;
i64 mod = 1e9 + 7;
i64 T, n, m, k;
vector<vector<i64>> dp;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(16);
  T = 1;
  for (i64 tt = 0; tt < T; ++tt) {
    cin >> n;
    queue<i64> q;
    for (i64 i = 1; i <= n; ++i) {
      q.push(i);
    }
    vector<i64> a(n + 1, 0);
    set<i64> sx;
    for (i64 i = 1; i <= n; ++i) {
      sx.emplace(i);
    }
    while (q.size() > 1) {
      i64 x = q.front();
      q.pop();
      i64 y = q.front();
      q.pop();
      cout << "? " << x << ' ' << y << endl;
      cout.flush();
      i64 x1;
      cin >> x1;
      cout << "? " << y << ' ' << x << endl;
      cout.flush();
      i64 y1;
      cin >> y1;
      if (x1 > y1) {
        a[x] = x1;
        q.push(y);
        sx.erase(x1);
      } else {
        a[y] = y1;
        q.push(x);
        sx.erase(y1);
      }
    }
    i64 z = q.front();
    a[z] = *sx.begin();
    cout << "! ";
    for (i64 i = 1; i <= n; ++i) {
      cout << a[i] << ' ';
    }
  }
  return 0;
}
