#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<long long>;
using vvb = vector<vector<bool>>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
using vpii = vector<pair<int, int>>;
using mii = map<int, int>;
template <typename... ArgTypes>
void print(ArgTypes... args);
template <typename... ArgTypes>
void input(ArgTypes &...args);
template <>
void print() {}
template <>
void input() {}
template <typename T, typename... ArgTypes>
void print(T t, ArgTypes... args) {
  cout << t;
  print(args...);
}
template <typename T, typename... ArgTypes>
void input(T &t, ArgTypes &...args) {
  cin >> t;
  input(args...);
}
int n;
vi ans;
void traverse(int now, int previous) {
  if (now > n) {
    ans[previous - 1] = n;
    return;
  }
  int a;
  int b;
  cout << "? " << now << " " << previous << endl;
  cout.flush();
  cin >> a;
  cout << "? " << previous << " " << now << endl;
  cout.flush();
  cin >> b;
  if (a > b) {
    ans[now - 1] = a;
    return traverse(now + 1, previous);
  }
  ans[previous - 1] = b;
  traverse(now + 1, now);
}
int main() {
  cin >> n;
  if (n == 1) {
    cout << "! 1" << endl;
    cout.flush();
    return 0;
  }
  ans = vi(n);
  traverse(2, 1);
  cout << "!";
  for (int i = 0; i < n; i++) cout << " " << ans[i];
  cout << endl;
  cout.flush();
}
