#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>

using namespace std;

int main()
{
    int n, i, j;
    cin >> n;

    if(n <= 300)
    {
        vector <int> color;
        color.resize(n);
        color[0] = 1;
        int lastcolor = 1;
        for(i = 1; i < n; i++)
        {
            bool detected = false;
            set <int> gen;
            int ans;
            for(j = 1; j <= i; j++)
            {
                gen.insert(color[i - j]);
                cout << "? " << (i - j + 1) << " " << i + 1 << endl;
                cin >> ans;
                //cout << "--->" << gen.size() << endl;
                if(ans == gen.size())
                {
                    color[i] = color[i - j];
                    detected = true;
                    break;
                }
            }
            if(not detected)
            {
                lastcolor++;
                color[i] = lastcolor;
            }
        }
        //answer
        cout << "Ready!" << endl << lastcolor << endl;
        for(i = 0; i < n; i++)
            cout << color[i] << " ";
        cout << endl;
        return 0;
    }

}
