#include <iostream>
#include <set>

using namespace std;

int* segtree;
int total;

int getInfo(int i, int j) {

    cout << "? " << i << ' ' << j << endl;
    cout.flush();
    int ans;
    cin >> ans;
    return ans;

}

void inc(int v, int l, int r, int left, int right) {

    if(left == l && right == r) {

        ++segtree[v];
        return;

    }

    int m = (l+r)/2;
    if(right <= m) {

        inc(2*v, l, m, left, right);
        return;

    }

    if(left > m) {

        inc(2*v+1, m+1, r, left, right);
        return;

    }

    inc(2*v, l, m, left, m);
    inc(2*v+1, m+1, r, m+1, right);

}

void inc(int left, int right) {

    inc(1, 1, total, left, right);

}

int getVal(int v, int l, int r, int id) {

    if(l == r)
        return segtree[v];

    int m = (l+r)/2;
    if(id <= m)
        return segtree[v] + getVal(2*v, l, m, id);
    else
        return segtree[v] + getVal(2*v+1, m+1, r, id);

}

int getVal(int id) {

    return getVal(1, 1, total, id);

}

int main() {

    cin >> total;

    segtree = new int[4*total+5];
    for(int i=0; i<4*total+5; ++i)
        segtree[i] = 0;

    int* ans = new int[total+1];
    ans[1] = 1;
    inc(1, 1);
    int colors = 1;

    for(int i=2; i<=total; ++i) {

        int cur = getInfo(1, i);
        if(cur != colors) {

            ans[i] = (++colors);
            inc(1, i);
            continue;

        }

        int l = 0;
        int r = i;
        while(r-l > 1) {

            int m = (l+r)/2;
            if(getInfo(m, i) == getVal(m))
                l = m;
            else
                r = m;

        }

        ans[i] = ans[l];

        inc(max(l-1, 1), i);

    }

    cout << "Ready!\n";
    cout << colors << endl;
    for(int i=1; i<=total; ++i)
        cout << ans[i] << ' ';
    cout << endl;

    return 0;

}
