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


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

int fnd(int a, int l, int r) {
	if (l > 0) {
		if (pr[a][r] - pr[a][l - 1] > 1) {
			return 1;
		}
	}
	else {
		if (pr[a][r] > 1)return 1;
	}
	return 0;
}


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;
		for (j = 0; j < 3007; j++) {
			pr[i][j] = 0;
		}
	}
	n = v.size();
	
	int s,fr=1;

	for (i = 0; i < n; i++) {

		s = 0;
		for (j = 1; j < fr; j++) {
			s += fnd(j, 0, i);
		}
		if (ask2(0, i) + s < i+1) {
			l = 0;
			r = i;
			while (r - l > 1) {
				m = (l + r) / 2;
				s = 0;
				for (j = 1; j < fr; j++) {
					s += fnd(j, m, i);
				}
				if (ask2(m, i) + s < i - m + 1) {
					l = m;
				}
				else {
					r = m;
				}
			}
			q[i] = q[l];
		}
		else {
			q[i] = fr;
			fr++;
		}
		pr[q[i]][i]++;
		for (j = 1; j < fr; j++) {
			pr[j][i+1] = pr[j][i];
		}
	}


	printf("Ready!\n");
	printf("%d\n", fr - 1);
	for (i = 0; i < n; i++) {
		for (j = 0; j < v[i]; j++) {
			printf("%d ", q[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;
}