#include <bits/stdc++.h>

using namespace std;

map< pair<int, int>, int> resp;

vector<int> test = {1, 2, 1, 2, 1};

int _query(int l, int r) {
    int res = 0;
    set<int> t;
    for (int i = l; i <= r; i++)
        t.insert(test[i]);
    return (int)t.size();
}

int query(int l, int r) {

    if (l == r)
        return 1;

    if (resp.count({l, r}))
        return resp[{l, r}];

    cout << "? " << l + 1 << ' ' << r + 1 << endl;
    cout.flush();
    int res;
    cin >> res;
    resp.insert({{l, r}, res});
    return res;
}

bool wasBefore(int i) {
    if (i == 0)
        return false;

    return (query(0, i - 1) == query(0, i));
}

bool isEqual(int l, int r) {
    if (r - l == 1)
        return (query(l, r) == 1);
    else
        return (query(l + 1, r) == query(l, r) && query(l, r - 1) == query(l, r));
}

int main() {

    int n;
    cin >> n;
    vector<int> ans(n, 1);
    int cnt = 1;
    for (int i = 1; i < n; i++) {
        int j = i - 1;

        if (wasBefore(i))
            while (j >= 0 && !isEqual(j, i))
                j--;
        else
            j = -1;


        if (j >= 0)
            ans[i] = ans[j];
        else
            ans[i] = ++cnt;
    }

    cout << "Ready!" << endl;
    cout << cnt << endl;
    for (auto& i : ans)
        cout << i << ' ';
    cout << endl;
    cout.flush();

    return 0;
}