#include<bits/stdc++.h>
using namespace std;

#define xx first
#define yy second
typedef long long ll;
typedef pair<int, int> pii;

int main()
{
    int n;
    cin >> n;
    vector<pii> ans(0);
    int p1 = 1, p;
    int i = 1;
    for(int j = 2; j <= n; j++)
    {
        cout << "? " << i << " " << j << endl;
        cin >> p;
        if (p != p1)
        {
            ans.push_back({i, j-1});
            i = j;
        }
    }
    ans.push_back({i, n});
    vector<int> col(ans.size());
    col[0] = 1;
    int c = 1;
    for(int i = 1; i < ans.size(); i++)
    {
        cout << "? 1 " << ans[i].yy << endl;
        cin >> p;
        if(p > c)
        {
            col[i] = c + 1;
            c++;
            continue;
        }
        p1 = 1;
        for(int j = i-1; j >= 0; j--)
        {
            cout << "? " << ans[j].xx << " " << ans[i].yy << endl;
            cin >> p;
            if(p != p1)
            {
                p1 = p;
                continue;
            }
            else
            {
                col[i] = col[j];
                break;
            }
        }
    }
    cout << "Ready!" << endl;
    cout << c << endl;
    for(int i = 0; i < ans.size(); i++)
    {
        for(int j = ans[i].xx; j <= ans[i].yy; j++)
            cout << col[i] << " ";
    }
    cout << endl;
    return 0;
}
