#include <bits/stdc++.h>
using namespace std;
int wait;
const double pi =
    3.14159265358979323846264338327950288419716939937510582097494459;
const double EPS = 1e-12;
const int meminf = 0x3f;
const int MAXN = 1e5 + 10;
const long long MOD = 1e9 + 7;
const long long Mod = 1e9 + 7;
const long long mod = 1e9 + 7;
const long long modd = 998244353;
const int MAX = 1e7 + 5;
const int oo = 2e9 + 10;
const long long OO = 1e18 + 10;
const int N = 1e5 + 5;
const int logN = (int)(log2(N));
int dx[] = {0, 1, 0, -1, -1, -1, 1, 1};
int dy[] = {1, 0, -1, 0, -1, 1, -1, 1};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
int main() {
  map<pair<int, int>, int> mods;
  int n;
  cin >> n;
  int mx = 0;
  int tmp;
  vector<int> vec(n, -1);
  for (int i = 1; i < n; i++) {
    cout << "? " << i + 1 << " " << mx + 1 << endl;
    cout.flush();
    cin >> tmp;
    mods[{i, mx}] = tmp;
    cout << "? " << mx + 1 << " " << i + 1 << endl;
    cout.flush();
    cin >> tmp;
    mods[{mx, i}] = tmp;
    if (mods[{mx, i}] > mods[{i, mx}]) {
      vec[mx] = mods[{mx, i}];
      mx = i;
    } else {
      vec[i] = mods[{i, mx}];
    }
  }
  vec[mx] = n;
  cout << "! ";
  for (auto x : vec) cout << x << " ";
  cout << "\n";
}
