#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<algorithm>
#include<iostream>
#include<set>
#include<cassert>
using namespace std;
const int MAXN = 6007;
int color[MAXN];
int getDifferent(int l, int r)
{
	set<int>have;
	for (int i = l; i <= r; i++)
	{
		have.insert(color[i]);
	}
	return have.size();
}
int ask(int l, int r)
{
	assert(l <= r);
	cout << "? " << l << " " << r << endl;
	int ans;
	cin >> ans;
	return ans;
}
int main()
{
	int n;
	cin >> n;
	int lst = 1;
	color[1] = 1;
	for (int i = 2; i <= n; i++)
	{
		if (ask(1, i) != getDifferent(1, i - 1))
		{
			color[i] = lst + 1;
			lst++;
			continue;
		}
		int l = 1, r = i;
		while (r - l > 1)
		{
			int m = (l + r) / 2;
			if (ask(m, i) == getDifferent(m, i - 1))
			{
				l = m;
			}
			else
			{
				r = m;
			}
		}
		color[i] = color[l];
	}
	cout << "Ready!" << endl;
	cout << lst << endl;
	for (int i = 1; i <= n; i++)
	{
		cout << color[i] << ' ';
	}
	cout << endl;
	return 0;
}