#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

typedef pair <int, int> pii;
const int mn = 3010;
int n, m, cnt, par[mn], clr[mn];
pii p[mn];

int find(int v) {
	if (par[v] == v) {
		return v;
	}
	int x = find(par[v]);
	par[v] = x;
	return x;
}

void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if (x < y) {
		par[y] = x;
	} else {
		par[x] = y;
	}
}

int ask(int l, int r) {
	cout << "? " << l + 1 << " " << r + 1 << endl;
	int x;
	cin >> x;
	return x;
}

void answer() {
	cout << "Ready!" << endl;
	int k = 1, lst = 0;
	for (int i = 0; i < n; i++) {
		if (find(i) != lst) {
			clr[i] = k;
			k++;
			lst = find(i);
		}
	}
	cout << k << endl;
	for (int i = 0; i < n; i++) {
		cout << clr[find(i)] + 1 << " ";
	}
	cout << endl;
}

int main() {
	cin >> n;
	cnt = 0;
	int l = 0, r = 1;
	while (r < n) {
		int x = ask(l, r);
		if (x != 1) {
			p[cnt].first = l;
			p[cnt].second = r - l;
			l = r;
			par[r] = r;
			cnt++;
		} else {
			par[r] = l;
		}
		r++;
	}
	p[cnt].first = l;
	p[cnt].second = n - l;
	cnt++;
	int last = 2;
	for (int i = 2; i < cnt; i++) {
		int x = ask(0, p[i].first);
		if (x == last) {
			l = 0;
			r = i;
			while (r != l + 1) {
				int m = (l + r) / 2;
				if (m + 1 == i) {
					r = m;
					break;
				}
				int q1 = ask(p[m].first, p[i].first);
				int q2 = ask(p[m].first, p[i].first - 1);
				if (q1 == q2) {
					l = m;
				} else {
					r = m;
				}
			}
			unite(p[l].first, p[i].first);
		}
		last = x;
	}
	answer();
	return 0;
}