#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(v) v.begin(), v.end()

int main(){
    //freopen("input.txt", "r", stdin);
    //freopen(".in", "r", stdin);
    //freopen(".out", "r", stdin);
    int n;
    cin >> n;
    vector<int> ans(n);
    vector<int> rb;
    ans[0] = 0;
    rb.push_back(0);
    int k = 0;
    for (int i = 1; i < n; i++){
        cout << "? " << "1 " << i + 1 << endl;
        int ot;
        cin >> ot;
        if (ot > k + 1){
            ans[i] = k + 1;
            rb.push_back(i);
            k++;
            continue;
        }
        vector<int> t;
        for (int j = 0; j <= k; j++){
            t.push_back(rb[j]);
        }
        sort(all(t));
        int l = 0, r = k + 1;
        while (r - l > 1){
            int m = (l + r) / 2;
            cout << "? " << t[m] + 1 << " " << i + 1 << endl;
            cin >> ot;
            if (ot == k + 1 - m + 1){
                r = m;
            } else {
                l = m;
            }
        }
        ans[i] = ans[t[l]];
        rb[ans[i]] = i;
    }
    cout << "Ready!" << endl << k + 1 << endl;
    for (int i = 0; i < n; i++){
        cout << ans[i] + 1 << " ";
    }
    cout << endl;
    return 0;
}
