#include <bits/stdc++.h>
const int md = 1000000007;
using namespace std;
using namespace std::chrono;
long long pw(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = (c * m);
    m = (m * m);
    b /= 2;
  }
  return c;
}
long long pwmd(long long a, long long b) {
  long long c = 1, m = a;
  while (b) {
    if (b & 1) c = (c * m) % md;
    m = (m * m) % md;
    b /= 2;
  }
  return c;
}
long long modinv(long long n) { return pwmd(n, md - 2); }
long long inverse(long long i) {
  if (i == 1) return 1;
  return (md - ((md / i) * inverse(md % i)) % md + md) % md;
}
long long ceel(long long a, long long b) {
  if (a % b == 0)
    return a / b;
  else
    return a / b + 1;
}
long long my_log(long long n, long long b) {
  long long i = 1;
  long long ans = 0;
  while (1) {
    if (i > n) {
      ans--;
      break;
    }
    if (i == n) break;
    i *= b;
    ans++;
  }
  return ans;
}
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
vector<char> capl = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
                     'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
                     'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'};
vector<char> sml = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                    'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                    's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
string conv(long long a) {
  string b;
  long long e = 2;
  long long c = my_log(a, e);
  c++;
  b = '1';
  for (int i = 0; i < c - 1; i++) {
    long long k = a >> (c - 2 - i);
    if (k & 1)
      b += '1';
    else
      b += '0';
  }
  if (a == 0) return "0";
  return b;
}
long long mysqt(long long a) {
  long long ans = 1;
  while (ans * ans <= a) ans++;
  ans--;
  return ans;
}
bool isprime(int p) {
  int i = 2;
  while (i <= sqrt(p)) {
    if (p % i == 0) {
      return false;
    }
    i++;
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, a, b;
  cin >> n;
  vector<int> ans(n + 1);
  int in = 1;
  vector<int> v;
  for (int i = 2; i < n + 1; i++) {
    cout << "? " << in << " " << i << "\n", cout.flush();
    cin >> a;
    if (a == -1) return 0;
    cout << "? " << i << " " << in << "\n", cout.flush();
    cin >> b;
    if (b == -1) return 0;
    if (a > b)
      ans[in] = a, in = i;
    else
      ans[i] = b, in = in;
  }
  cout << "! ";
  vector<int> vis(n + 1);
  for (int i = 1; i < n + 1; i++) vis[ans[i]] = 1;
  int pp;
  for (int i = 1; i < n + 1; i++) {
    if (vis[i] == 0) {
      pp = i;
      break;
    }
  }
  for (int i = 1; i < n + 1; i++) {
    if (ans[i] == 0)
      cout << pp << " ";
    else
      cout << ans[i] << " ";
  }
  cout << "\n", cout.flush();
}
