#pragma warning(disable:4996)
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;


int n, k,st[3007],p[3007];
map<pair<int, int>,int>mp;
vector<int>v;
map<int, int>ck;

int ask(int a, int b) {
	int x;
	if (a == b)return 1;
	if (mp[make_pair(a, b)] == 0) {
		printf("? %d %d\n", a+1, b+1);
		fflush(stdout);
		scanf("%d", &x);
		mp[make_pair(a, b)] = x;
		return x;
	}
	else {
		return mp[make_pair(a, b)];
	}
}

int ask2(int a, int b) {
	if (a == b)return 1;
	if (a + 1 == b)return 2;
	return ask(st[a], st[b+1]-1);
}

int find(int x) {
	if (p[x] == x)return x;
	else return p[x] = find(p[x]);
}

void uni(int a, int b) {
	p[find(a)] = find(b);
}

void sol() {
	int i, j, l, r, m;
	scanf("%d", &n);
	for (i = 0; i < n;) {
		l = i;
		r = n - 1;
		while (r - l > 1) {
			m = (l + r) / 2;
			if (ask(i, m) > 1) {
				r = m;
			}
			else {
				l = m;
			}
		}
		if (ask(i, r) == 1) {
			v.push_back(r - i + 1);
		}
		else {
			v.push_back(l - i + 1);
		}
		i += v.back();
	}
	st[0] = 0;
	for (i = 1; i <= v.size(); i++)st[i] = st[i - 1] + v[i - 1];
	i = i;
	for (i = 0; i < 3007; i++)p[i] = i;
	int dif = 1;
	r = 0;
	n = v.size();
	for (l = 0; l < n;) {
		while (r + 1 < n&&ask2(l, r + 1) == r - l + 2) {
			r++;
		}
		if (r == n - 1) {
			l = n;
		}
		else {
			while (ask2(l, r + 1) != r - l + 2) {
				l++;
			}
			uni(l - 1, r + 1);
			r++;
		}
	}
	int fr = 1;
	printf("Ready!\n");
	for (i = 0; i < n; i++) {
		if (ck[find(i)] == 0) {
			ck[find(i)] = fr;
			ck[i] = fr;
			fr++;
		}
		else {
			ck[i] = ck[find(i)];
		}
	}
	printf("%d\n", fr - 1);
	for (i = 0; i < n;i++){
		for (j = 0; j < v[i]; j++) {
			printf("%d ", ck[i]);
		}
	}
	n = n;
}

int main() {
#ifdef _DEBUG
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
#else
//	freopen("video.in", "r", stdin);
//	freopen("video.out", "w", stdout);
#endif
	sol();
	return 0;
}