#include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    int arr[3030];
    arr[1] = 1;
    vector <int> nw;
    int dif = 1;
    nw.push_back(1);
    for(int i = 2; i <= n; i++) {
        cout << "? " << 1 << " " << i << endl;
        int ans;
        cin >> ans;
        if (ans == dif + 1) {
            dif++;
            nw.push_back(i);
            arr[i] = dif;
        }
        else {
            int b = 0, e = (int)nw.size();
            /*cout << "           " << e << endl;
            for(int j = 0; j < e; j++) {
                cout << nw[j] << " ";
            }
            cout << endl;*/
            while(b + 1 != e) {
                int m = (b + e) / 2;
                int dif1 = arr[nw[m]];
                cout << "? " << nw[m] << " " << i << endl;
                int check;
                cin >> check;
                if (check == (int)nw.size() - m) {
                    b = m;
                }
                else {
                    e = m;
                }
            }
            arr[i] = arr[nw[b]];
            for(int j = 0; j < (int)nw.size(); j++) {
                if (arr[nw[j]] == arr[i]) {
                    vector <int> ch;
                    for(int k = 0; k < j; k++) {
                        ch.push_back(nw[k]);
                    }
                    for(int k = j + 1; k < (int)nw.size(); k++) {
                        ch.push_back(nw[k]);
                    }
                    nw = ch;
                    break;
                }
            }
            nw.push_back(i);
            /*for(int j = 0; j < (int)nw.size(); j++) {
                cout << nw[j] << " ";
            }
            cout << endl;*/
        }
    }
    cout << "Ready!" << endl;
    cout << (int)nw.size() << endl;
    for(int i = 1; i <= n; i++) {
        cout << arr[i] << " ";
    }
    return 0;
}
