#include <iostream>
#include <algorithm>
#include <utility>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <numeric>
#include <cstdlib>
#include <cstdint>
#include <cmath>
#include <functional>
#include <limits>
#include <cassert>
#include <bitset>

using namespace std;

/* template */

using ll = long long;

void debug_out() { std::cout << std::endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << H << " ";
  debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cout << "debug: "; debug_out(__VA_ARGS__)
#else
#define debug(...) 
#endif

#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)
#define rrep(i, a, n) for (int i = ((int)(n-1)); i >= (int)(a); i--)
#define Rep(i, a, n) for (long long i = (long long)(a); i< (long long)(n); i++)
#define RRep(i, a, n) for (long long i = ((long long)(n-1ll)); i>=(long long)(a); i--)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()

/* xxpoxx's definition */
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
using vl = vector<ll>;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (std::size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}

struct Edge{
    int to;
    ll weight;
    Edge(int t, ll w) : to(t), weight(w){ }
};

struct edge{
    int from;
    int to;
    ll weight;
    edge(int f,int t,ll w) : from(f), to(t), weight(w){ }
};


using Graph = vector<vector<Edge>>;
using graph = vector<vector<int>>;
using edges = vector<edge>;

template <class T>
inline bool chmin(T &a, T b){
    if (a > b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b){
    if (a < b){
        a = b;
        return true;
    }
    return false;
}

template <class T>
T lcm(T a, T b){
    return (a*b)/gcd(a,b);
}

constexpr ll LNF = 1LL<<60;

constexpr int INF = 1e9+7;

const double PI=3.14159265358979323846;


vector<int> dx = {-1,0,1,0,-1,1,-1,1};
vector<int> dy = {0,-1,0,1,1,-1,-1,1};

/* template */

int main(){
    // c書いてますね
    ll n;
    cin >> n;
    map<ll, ll> one_to;
    ll ma = 0;
    ll haji;
    for(ll i = 2; i < n+1; i++){
        cout << "? 1 ";
        cout << i << endl;
        ll tmp;
        cin >> tmp;
        one_to[i] = tmp;
        if(tmp > ma){
            ma = tmp;
            haji = i;
        }
    }
    vector<pair<ll,ll>> hajikara;
    for(ll i = 1; i < n+1; i++){
        if(i == 1){
            hajikara.push_back(make_pair(ma, 1));
            continue;
        }
        if(i == haji){
            hajikara.push_back(make_pair(0, haji));
            continue;
        }
        cout << "? " << haji << " " << i << endl;
        ll tmp;
        cin >> tmp;
        hajikara.push_back(make_pair(tmp, i));
    }
    sort(ALL(hajikara));
    vector<ll> ans;
    REP(i, n){
        ans.push_back(hajikara[i].second);
    }
    cout <<"! ";
    REP(i, n){
        if(i == n-1){
            cout << ans[i];
        }else{
            cout << ans[i] << " ";
        }
    }
    cout << endl;
    /*
    ll N,S,P,C;
    cin >>N;
    vector<ll> r(N),score(N),Sr(N),Pr(N),Cr(N);
    for(ll i=0;i<N;i++) cin >>r[i];
    vector<pair<ll,ll>> s(N), p(N), c(N);
    for(ll i=0;i<N;i++){
        ll a1,a2,a3;
        cin >>a1>>a2>>a3;
        s[i]=make_pair(a1,i);
        p[i]=make_pair(a2,i);
        c[i]=make_pair(a3,i);
    }
    S=s[0].first; P=p[0].first; C=c[0].first;
    sort(s.begin(),s.end());
    sort(p.begin(),p.end());
    sort(c.begin(),c.end());
    reverse(s.begin(),s.end());
    reverse(p.begin(),p.end());
    reverse(c.begin(),c.end());
    //スマイルの初期点計算
    ll douritsu=0;
    ll rank=0;
    for(ll i=0;i<N;i++){
        score[s[i].second]+=r[rank];
        Sr[s[i].second]=rank;
        if(i!=N-1){
            if(s[i].first==s[i+1].first) douritsu++;
            else{
                rank+=douritsu+1;
                douritsu=0;
            }
        }
    }
    //ぴゅあの初期点計算
    douritsu=0;
    rank=0;
    for(ll i=0;i<N;i++){
        score[p[i].second]+=r[rank];
        Pr[p[i].second]=rank;
        if(i!=N-1){
            if(p[i].first==p[i+1].first) {
                douritsu++;
            }else{
                rank+=douritsu+1;
                douritsu=0;
            }
        }
    }
    //くーるの初期点計算
    douritsu=0;
    rank=0;
    for(ll i=0;i<N;i++){
        score[c[i].second]+=r[rank];
        Cr[c[i].second]=rank;
        if(i!=N-1){
            if(c[i].first==c[i+1].first) {
                douritsu++;
            }else{
                rank+=douritsu+1;
                douritsu=0;
            }
        }
    }
    vector<ll> score2 = score;
    ll ans=LNF;
    //for(ll j=1; j<N; j++) cout << score[j] << endl;
    // すまいるを値変えるとき
    for(ll i=S+1;i<=100;i++){
        for(ll j=0;j<N;j++){
            if(s[j].second==0) continue;
            if(s[j].first>i) continue;
            else if(s[j].first==i) score2[0]+=r[j]-r[Sr[0]];
            else if(s[j].first>=s[0].first) score2[j]+=r[Sr[j]]-r[Sr[j]+1];
        }
        ll rank=N;
        for(ll j=1; j<N; j++) {
            if(score2[j]<=score2[0]) rank--;
        }
        cout << i << " " << rank << endl;
        if(rank<=8) ans=min(ans,i-S);
    }
    cout << ans;
    */
}



Measured memory_bytes: 3960