#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
vector<long long int> arr(500005);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    long long int n;
    cin >> n;
    set<long long int> have;
    stack<long long int> idx;
    vector<long long int> ans(n + 5);
    for (long long int i = 1; i <= n; i++) {
      have.insert(i);
      idx.push(i);
    }
    while (idx.size() > 1) {
      long long int a = idx.top();
      idx.pop();
      long long int b = idx.top();
      idx.pop();
      cout << "? " << a << " " << b << "\n";
      cout.flush();
      long long int x1, x2;
      cin >> x1;
      cout << "? " << b << " " << a << "\n";
      cout.flush();
      cin >> x2;
      if (x1 > x2) {
        have.erase(x1);
        ans[a] = x1;
        idx.push(b);
      } else {
        have.erase(x2);
        ans[b] = x2;
        idx.push(a);
      }
    }
    ans[idx.top()] = *(have.begin());
    cout << "! ";
    for (int i = 1; i <= n; i++) {
      cout << ans[i] << " ";
    }
    cout << "\n";
    cout.flush();
  }
}
