#include <bits/stdc++.h>
using namespace std;
long long int c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, t, x, y, z;
long long int mn = 8675435789, mx = -8675868757, md = 1000000007, aa = 0,
              bb = 0, cc = 0;
string r, s, u, v, w;
long long int a[950002], b[950002];
map<long long int, long long int> mp, mq;
queue<long long int> qu, qe;
pair<long long int, long long int> pp[30030];
set<string> se, sa;
int main() {
  {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
  cin >> n;
  cc = 1;
  for (i = 2; i < n + 1; i++) {
    cout << "? " << cc << ' ' << i << endl;
    cin >> x;
    cout << "? " << i << ' ' << cc << endl;
    cin >> y;
    if (x > y) {
      a[cc] = x;
      cc = i;
    } else
      a[i] = y;
  }
  a[cc] = n;
  cout << "! ";
  for (i = 1; i < n + 1; i++) cout << a[i] << ' ';
  cout << endl;
}
