#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>

using namespace std;

vector <int> dna;
vector <int> dif;

int main() {
    int n, cur = 2, s;
    cin >> n;
    dna.push_back(-1);
    dna.push_back(1);
    dif.push_back(2);
    dif.push_back(1);
    for (int i = 2; i < n + 1; i++) {
        int l = 0;
        int r = i;
        dif.push_back(0);
        while (r - l > 1) {
            //cout << l << " " << r << endl;
            int m = (r + l) / 2;
            cout << "? " << m << " " << i << endl;
            cout.flush();
            cin >> s;
            if (s > dif[m]) {
                r = m;
            }
            else {
                l = m;
            }
        }
        if (dna[l] == -1) {
            dna.push_back(cur);
            cur += 1;
        }
        else {
            dna.push_back(dna[l]);
        }
        for (int p = r; p < i + 1; p++) {
            dif[p] += 1;
        }
    }
    cout << "Ready!" << endl;
    cout << cur - 1 << endl;
    for (int i = 1; i < n + 1; i++) {
        cout << dna[i] << " ";
    }
}
