#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T>& operator--(vector<T>& v) {
  for (auto& i : v) --i;
  return v;
}
template <typename T>
vector<T>& operator++(vector<T>& v) {
  for (auto& i : v) ++i;
  return v;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
  for (auto& i : v) is >> i;
  return is;
}
template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
  for (auto& i : v) os << i << ' ';
  return os;
}
template <typename T, typename U>
istream& operator>>(istream& is, pair<T, U>& p) {
  is >> p.first >> p.second;
  return is;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& p) {
  os << p.first << ' ' << p.second;
  return os;
}
template <typename T, typename U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
template <typename T, typename U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
template <typename T, typename U>
void umin(T& a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
void umax(T& a, U b) {
  if (a < b) a = b;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> p(n, 0);
  auto ask = [&](int i, int j) {
    cout << "? " << i + 1 << ' ' << j + 1 << endl;
    int k;
    cin >> k;
    return k;
  };
  set<int> unknown;
  for (int i = 0; i < n; ++i) {
    unknown.insert(i);
  }
  while (unknown.size() >= 2) {
    int i1 = *unknown.begin();
    unknown.erase(unknown.begin());
    int i2 = *unknown.begin();
    unknown.erase(unknown.begin());
    int a = ask(i1, i2);
    int b = ask(i2, i1);
    if (a > b) {
      p[i1] = a;
      unknown.insert(i2);
    } else {
      p[i2] = b;
      unknown.insert(i1);
    }
  }
  long long s = (accumulate((p).begin(), (p).end(), 0ll));
  p[*unknown.begin()] = (long long)n * (n + 1) / 2 - s;
  cout << "! " << p << endl;
  return 0;
}
