#include <bits/stdc++.h>
#pragma GCC optimize "trapv"
using namespace std;
void huehue(istream_iterator<string> it) {}
template <typename T, typename... Args>
void huehue(istream_iterator<string> it, T a, Args... args) {
  cout << *it << " = " << a << ", ";
  huehue(++it, args...);
}
template <class T>
T inf() {
  return numeric_limits<T>::max();
}
void read() { return; }
void print() { return; }
void println() {
  cout << "\n";
  return;
}
template <class T>
T read(T &x) {
  cin >> x;
  return x;
}
template <class T>
void print(T a) {
  cout << a;
}
template <class T>
void println(T a) {
  cout << a << "\n";
}
template <class T>
void read(vector<T> &arr) {
  for (auto &i : arr) cin >> (i);
}
template <class T>
void print(vector<T> arr) {
  for (auto &i : arr) {
    cout << i << " ";
  }
}
template <class T>
void println(vector<T> arr) {
  for (auto &i : arr) {
    cout << i << " ";
  }
  cout << "\n";
}
template <class T>
void read(vector<vector<T>> &arr) {
  for (auto &i : arr) read(i);
}
template <class T>
void print(vector<vector<T>> arr) {
  for (auto &i : arr) println(i);
}
template <class T>
void println(vector<vector<T>> arr) {
  for (auto &i : arr) println(i);
}
template <typename T, typename... Args>
void read(vector<T> &arr, Args &...args) {
  read(arr);
  read(args...);
}
template <typename T, typename... Args>
void read(vector<vector<T>> &arr, Args &...args) {
  read(arr);
  read(args...);
}
template <typename T, typename... Args>
void read(T &a, Args &...args) {
  cin >> (a);
  read(args...);
}
template <typename T, typename... Args>
void print(vector<T> &arr, Args &...args) {
  print(arr);
  print(args...);
}
template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " ";
  print(args...);
};
template <typename T, typename... Args>
void println(vector<T> &arr, Args &...args) {
  print(arr);
  println(args...);
}
template <typename T, typename... Args>
void println(T a, Args... args) {
  cout << a << " ";
  println(args...);
};
const long long int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const long long int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1},
                    d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
void solveEachTest(long long int _TestCase) {
  long long int n;
  read(n);
  vector<long long int> arr(n + 1);
  set<long long int> indices;
  for (long long int i = 0ll; i < n; (i) += 1ll) {
    indices.insert(i + 1);
  }
  for (long long int qq = 0ll; qq < n; (qq) += 1ll) {
    long long int firstOne = -1, secondOne = -1;
    if (((int)((indices).size())) == 1) {
      break;
    }
    for (auto &jj : indices) {
      if (firstOne == -1) {
        firstOne = jj;
        continue;
      } else if (secondOne == -1) {
        secondOne = jj;
        break;
      } else {
        break;
      }
    }
    long long int query1Ans, query2Ans;
    println("?", firstOne, secondOne);
    read(query1Ans);
    println("?", secondOne, firstOne);
    read(query2Ans);
    if (query1Ans > query2Ans) {
      arr[firstOne] = query1Ans;
      indices.erase(firstOne);
    } else {
      arr[secondOne] = query2Ans;
      indices.erase(secondOne);
    }
  }
  set<long long int> tempSet;
  for (long long int i = 0ll; i < n; (i) += 1ll) {
    tempSet.insert(i + 1);
  }
  for (auto i = (1); (((1) > 0) ? (i) < (n + 1) : (i) > (n + 1)); (i) += (1)) {
    if (arr[i] != 0) tempSet.erase(arr[i]);
  }
  long long int temp = 0;
  if (((int)((tempSet).size())) > 0) {
    temp = (*tempSet.begin());
  }
  cout << "! ";
  for (auto i = (1ll); (((1ll) > 0) ? (i) < (n + 1ll) : (i) > (n + 1ll));
       (i) += (1ll)) {
    if (arr[i] == 0) {
      arr[i] = temp;
    }
    cout << arr[i] << " ";
  }
  cout << "\n";
  return;
}
signed main() {
  long long int T3X0 = 0, T353 = 1;
  solveEachTest(T353 - T3X0);
  return 0;
}
