#include <iostream>
#include <map>
#include <set>
#include <deque>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <iterator>
#include <ctime>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <assert.h>

using namespace std;

const int MAXN = 3000;
int ans[MAXN + 1], sz;
map<pair<int, int>, int> mem;

void solve(int l, int r) {
	map<int, int> calc;
	if (r - l + 1 == 1)
		ans[l] = 1;
	else if (r - l + 1 == 2) {
		cout << "? " << l << " " << r << endl;
		int res;
		cin >> res;
		mem[{l, r}] = res;
		if (res == 2)
			ans[l] = 1, ans[r] = 2;
		else
			ans[l] = ans[r] = 1;
	}
	else {
		int m = (l + r) / 2;
		solve(l, m);
		solve(m + 1, r);
		cout << "? " << l << " " << m << endl;
		int temp;
		cin >> temp;
		mem[{l, m}] = temp;
		int clc = 0;
		for (int i = m + 1; i <= r; i++) {
			if (calc[ans[i]]) {
				ans[i] = calc[ans[i]];
				continue;
			}
			int bot = l - 1, top = m + 1, mid;
			mid = l;
			int res1, res2;
			if (!mem[{mid, i}]) {
				cout << "? " << mid << " " << i << endl;
				cin >> res1;
				mem[{mid, i}] = res1;
			}
			else
				res1 = mem[{mid, i}];
			if (!mem[{mid, i - 1}]) {
				cout << "? " << mid << " " << i - 1 << endl;
				cin >> res2;
				mem[{mid, i - 1}] = res2;
			}
			else
				res2 = mem[{mid, i - 1}];
			if (res1 == res2) {
				while (top > bot + 1) {
					mid = (top + bot) / 2;
					res1, res2;
					if (!mem[{mid, i}]) {
						cout << "? " << mid << " " << i << endl;
						cin >> res1;
						mem[{mid, i}] = res1;
					}
					else
						res1 = mem[{mid, i}];
					if (!mem[{mid, i - 1}]) {
						cout << "? " << mid << " " << i - 1 << endl;
						cin >> res2;
						mem[{mid, i - 1}] = res2;
					}
					else
						res2 = mem[{mid, i - 1}];
					if (res1 == res2)
						bot = mid;
					else
						top = mid;
				}
			}
			else {
				int temp = ans[i];
				ans[i] = ans[l];
				for (int j = l; j <= i - 1; j++)
					ans[i] = max(ans[i], ans[j]);
				ans[i]++;
				calc[temp] = ans[i];
			}
			else {
				calc[ans[i]] = ans[bot];
				ans[i] = ans[bot];
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");

	int n;
	cin >> n;
	solve(1, n);
	cout << "? " << 1 << " " << n << endl;
	sz++;
	assert(sz <= 70000);
	int temp;
	cin >> temp;
	map<int, int> res;
	for (int i = 1; i <= n; i++)
		res[ans[i]] = 1;
	assert(temp == (int)res.size());
	cout << "Ready!" << endl;
	cout << (int)res.size() << endl;
	for (int i = 1; i <= n; i++) {
		cout << ans[i] << " ";
	}
	cout << endl;
	return 0;
}