#include <iostream>
#include <cstdio>
#include <vector>
#include <string>

using namespace std;

int query(int i, int j)
{
    if (i == j)
        return 1;
    cout << "? " << i + 1 << " " << j + 1 << endl;
    int a;
    cin >> a;
    return a;
}

int main()
{
    int n;
    cin >> n;
    int* ans = new int[n];
    for (int i = 0; i < n; i++)
        ans[i] = -1;
    int c = 1;
    for (int i = 0; i < n; i++)
    {
        if (ans[i] == -1)
        {
            ans[i] = c;
            int last = i;
            for (int j = i + 1; j < n; j++)
            {
                if (ans[j] == -1 && query(last + 1, j) == query(last, j))
                {
                    ans[j] = c;
                    last = j;
                }
            }
            c++;
        }
    }
    cout << "Ready!" << endl;
    cout << c - 1 << endl;
    for (int i = 0; i < n; i++)
        cout << ans[i] << " ";
    cout << endl;
    return 0;
}
