#include <iostream>
#include <vector>


using namespace std;

const int MAX_N = 3e3;
const int MAX_K = 1e3;

int queries[MAX_N][MAX_N + 1];
int ans[MAX_N];
int totalUsed = 0;

int getQ(int left, int right) {
    if (left == right - 1) return 1;
    if (queries[left][right] != -1) return queries[left][right];
    cout << "? " << left + 1 << " " << right << endl;
    cout.flush();
    int q;
    cin >> q;
    queries[left][right] = q;
    return q;
}

int getNum(int ind) {
    int left = ind - 1;
    //vector<bool> used[MAX_K];
    while (left >= 0 and getQ(left, ind) + 1 == getQ(left, ind + 1)) left--;
    if (left == -1) return ++totalUsed;
    return ans[left];
}

int main() {
    for (int i = 0; i < MAX_N; i++) {
        for (int j = 0; j <= MAX_N; j++) {
            queries[i][j] = -1;
        }
    }
    int n;
    cin >> n;

    int curr = 0;
    while (curr < n) {
        int minRight = curr + 1, maxRight = n;
        if (getQ(curr, n) == 1) minRight = n;
        else {
            while (maxRight - minRight > 1) {
                int midRight = (maxRight + minRight) / 2;
                if (getQ(curr, midRight) > 1) maxRight = midRight;
                else minRight = midRight;
            }
        }

        int num = getNum(curr);
        for (; curr < minRight; curr++) ans[curr] = num;
    }

    cout << "Ready!" << endl;
    cout << totalUsed << endl;
    for (int i = 0; i < n; i++) {
        cout << ans[i] << " ";
    }
    cout << endl;
    cout.flush();

    return 0;
}
