#include <random>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

#pragma comment(linker, "/STACK:512000000")

using namespace std;

map<pair<int, int>, int> answers;

int real[100];
int realn;

int call(int i, int j) {
	if (i > j) {
		//cerr << i << ' ' << j << '\n';
		return 0;
	}
	if (i == j)
		return 1;

	if (answers.count({ i, j }))
		return answers[{i, j}];
	int ans;

	//set<int> ns;
	//for (int t = i; t <= j; t++)
	//	ns.insert(real[t]);
	//ans = ns.size();
	cout << "? " << i + 1 << ' ' << j + 1 << endl;
	cin >> ans;


	answers[{i, j}] = ans;
	return ans;
}

int32_t main() {
	//srand(224);
	//realn = rand() % 20;
	//for (int i = 0; i < realn; i++) real[i] = rand() % realn + 1;

	//ifstream cin("video.in");
	//ofstream cout("video.out");
	//ios::sync_with_stdio(false);
	
	int n;
	cin >> n;

	int nowq = 0;
	vector<int> lastpos;
	vector<int> ans(n);
	for (int i = 0; i < n; i++) {

		int l = -1, r = i;
		while (r - l > 1) {
			int m = (l + r) / 2;

			set<int> ts;
			for (int j = i; j < i; j++)
				ts.insert(ans[j]);

			if (call(m, i) == ts.size()) {
				l = m;
			}
			else r = m;
		}

		if (l == -1)
			ans[i] = ++nowq;
		else ans[i] = ans[l];
	}

	cout << "Ready!" << endl << nowq << endl;
	for (auto i : ans) cout << i << ' ';
	cout << endl;

	return 0;
}