#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793238462643383279;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long double eps = 0.000000000000001;
void boot_up() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.precision(15);
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
signed main() {
  boot_up();
  long long n, d;
  cin >> n;
  if (n == 1) {
    cout << "! " << 1 << endl;
    return 0;
  }
  vector<long long> b(n + 1, 0), nums(n + 1, 0);
  long long f, s;
  cout << "? " << 1 << " " << 2 << endl;
  cin >> f;
  cout << "? " << 2 << " " << 1 << endl;
  cin >> s;
  if (f > s) {
    d = 2;
    b[1] = f;
  } else {
    d = 1;
    b[2] = s;
  }
  for (long long i = 3; i <= n; i++) {
    cout << "? " << i << " " << d << endl;
    cin >> f;
    cout << "? " << d << " " << i << endl;
    cin >> s;
    if (f > s) {
      b[i] = f;
    } else {
      b[d] = s;
      d = i;
    }
  }
  for (long long i = 1; i <= n; i++) {
    nums[b[i]] = 1;
  }
  long long numb;
  for (long long i = 1; i <= n; i++) {
    if (nums[i] == 0) {
      numb = i;
    }
  }
  b[d] = numb;
  cout << "! ";
  for (long long i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  return 0;
}
