#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
    int n, k, l;
    cin >> n;
    k = n;
    vector<int> v(n, 0);
    vector<int> post(k, -1);
    v[0] = 1;
    post[0] = 0;
    int newn = 2;
    for(int i = 1; i < n; i++){
        bool res = false;
        cout << "? 1 " << i + 1 << endl;
        cin >> l;
        if(l == newn){
            v[i] = newn;
            post[newn - 1] = i;
            newn += 1;
        }
        else{
        int was = 0;
        vector<int> were(newn - 1);
        for(int o = 0; o < newn - 1; o++){
            were[o] = post[o];
        }
        int left = -1;
        int right = newn - 1;
        int middle;
        sort(were.rbegin(), were.rend());
        while(right - left > 1){
            middle = (left + right) / 2;
            cout << "? " << were[middle] + 1 << " " << i + 1 << endl;
            cin >> l;
            if(l == middle + 2){
                right = middle;
            }
            if(l < middle + 2) left = middle;
        }
        v[i] = v[were[left]];
        post[v[i] - 1] = i;
        /*for(int j = i - 1; j >= 0; j--){
            if(post[v[j] - 1] == j){
                    was += 1;
                    cout << "? " << j + 1 << " " << i + 1 << endl;
                    cin >> l;
                    if(l == was){
                        v[i] = v[j];
                        post[v[j] - 1] = i;
                        break;
                    }
                    //for(int i = 0; i < n; i++){
                    //    cout << v[i] << " ";
                    //}
                    //cout << endl;
                }

        }*/
        }
    }
    cout << "Ready!" << endl;
    cout << newn - 1 << endl;
    for(int i = 0; i < n; i++){
        cout << v[i] << " ";
    }
    cout << endl;
    return 0;
}
