#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;

map <pair <int, int>, int> mp;

int n;
vector <int> vec;
vector <int> out;

bool f[3013];
int sumsum[3013];
int zap(int l, int r) {
	if (l == r) {
		return 1;
	}
	int out;
	if (mp[make_pair(l, r)] == 0) {
		cout << "? " << l + 1 << " " << r + 1 << endl;
		cout.flush();
		cin >> out;
		mp[make_pair(l, r)] = out;
	}
	else {
		out = mp[make_pair(l, r)];
	}
	return out;
}
int main() {

	cin >> n;

	int ind = 0;

	while (ind < n) {
		int l = 0, r = n - ind;
		while (l < r - 1) {
			int m = (l + r) / 2;
			int z = zap(ind, ind + m);
			if (z == 1) {
				l = m;
			}
			else {
				r = m;
			}
		}

		vec.push_back(l + 1);
		ind = ind + l + 1;
	}

	for (int i = 1; i < vec.size() + 1; i++) {
		sumsum[i] = sumsum[i - 1] + vec[i - 1];
	}
	int now = 0;
	for (int i = 0; i < vec.size(); i++) {
		if (i == 0 || zap(0, sumsum[i + 1] - 1) != zap(0, sumsum[i] - 1)) {
			out.push_back(now + 1);
			now++;
			continue;
		}
		int l = 0, r = i + 1;
		while (l < r - 1) {
			int m = (l + r) / 2;
			int sum = sumsum[i + 1];
			int kol = sumsum[i + 1] - sumsum[i - m];
			int z1 = zap(sum - kol, sum - 1);
			int z2 = zap(sum - kol, sum - vec[i]);
			if (z1 == z2) {
				l = m;
			}
			else {
				r = m;
			}
		}
		
		out.push_back(out[i - l]);
	}

	cout << "Ready!" << endl;
	cout <<	now << endl;
	for (int i = 0; i < n; i++) {
		cout << out[i] << " ";
	}
	cout << endl;
	cout.flush();
	return 0;
}