#include <bits/stdc++.h>

#define int ll
#define ll long

using namespace std;

const int MAXN = 3005;

int a[MAXN];

map<pair<int, int>, int> q;

int _ask(int l, int r) {
    if (l == r)
        return 1;
    if (q.find({l, r}) != q.end())
        return q[{l, r}];
    int res;
    cout << "? " << l << ' ' << r << endl;
    cin >> res;
    q[{l, r}] = res;
    return res;
}

vector<pair<int, int> > v;

bool check(int i, int j) {
    int res1 = _ask(v[j].first, v[i].first - 1);
    int res2 = _ask(v[j].first, v[i].second);
    return res1 >= res2;
}

int bs(int l, int r, int i) {
    int m;
    while (l + 1 < r) {
        m = (l + r) / 2;
        if (check(i, m))
            l = m;
        else
            r = m;
    }
    return l;
}

#undef int
int main() {
    #define int ll
    int n, k;
    cin >> n;
    k = _ask(1, n);
    int cur = 1, pos = 1;
    v.reserve(n);
    while (pos <= n) {
        int mem = pos;
        a[pos] = cur;
        while (pos + 1 <= n && _ask(mem, pos + 1) == 1) {
            ++pos;
            a[pos] = a[pos - 1];
        }
        v.push_back({mem, pos});
        ++pos;
        ++cur;
    }
    vector<int> color(v.size()), mark(k + 1);
    for (int i = 2; i < v.size(); ++i) {
        int j = bs(0, i - 1, i);
        if (check(i, j)) {
            for (pos = v[i].first; pos <= v[i].second; ++pos)
                a[pos] = a[v[j].first];
        }
    }
    map<int, int> p;
    for (int i = 1, cur = 1; i <= n; ++i) {
        if (p.find(a[i]) == p.end()) {
            p[a[i]] = cur++;
        }
    }
    cout << "Ready!" << endl;
    cout << k << endl;
    for (int i = 1; i <= n; ++i)
        cout << p[a[i]] << ' ';
    cout << endl;

    return 0;
}
