#include <bits/stdc++.h>

using namespace std;

#define forn(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define NAME "video"
#define sz(a) (a.size())
#define FREOPEN freopen(NAME".in", "r", stdin); freopen(NAME".out", "w", stdout);

typedef long long ll;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;

const int INF = 2e9;
const ll INF64 = 9e18;
const int N = 100100;
const int M = 1010;

int nn, n, k, a[N];
bool mark[N];
vector < pii > b;

int get(int l, int r)
{
    cout << "? " << l << ' ' << r << endl;
    cout.flush();
    int z;
    cin >> z;
    return z;
}

void dfs(int v)
{
    //cout << "=======   " << v << endl;
    mark[v] = 1;
    a[v] = k;
    if (v == n)
        return;
    int l = v, r = n + 1;
    while (r - l > 1)
    {
        int m = (l + r) / 2;
        int z1 = get(b[v + 1].x, b[m].y);
        int z2 = get(b[v].x, b[m].y);

        if (z1 != z2)
            l = m;
        else
            r = m;
    }
    if (l + 1 <= n)
    dfs(l + 1);
}

int main()
{
    //FREOPEN;
    cin >> nn;
    int l = 1;
    b.pb(mp(0, 0));
    for (int i = 2; i <= nn; i++)
    {
        int z = get(i - 1, i);
        if (z == 2)
        {
            b.pb(mp(l, i - 1));
            l = i;
            n++;
        }
    }
    b.pb(mp(l, nn));
    n++;

    for (int i = 1; i <= n; i++)
        if (!mark[i])
        {
            //cout << "-----------  " << i << endl;
            k++;
            dfs(i);
        }
    cout << "Ready!" << endl;
    cout.flush();
    cout << k << endl;
    cout.flush();
    for (int i = 1; i <= n; i++)
        for (int j = b[i].x; j <= b[i].y; j++)
            cout << a[i] << ' ';
    cout.flush();
    return 0;
}



/*





*/




