#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <climits>

using namespace std;

unordered_map<int, int> history;

int ask(int l, int r) {
	if (l > r) swap(l, r);
	if (l == r) return 1;

	l++, r++;

	if (history[l * 40000 + r] != 0) return history[l * 40000 + r];

	printf("? %d %d\n", l, r);
	fflush(stdout);
	int ans;
	scanf("%d", &ans);

	history[l * 40000 + r] = ans;
	return ans;
}
vector<int> ans;
int n;
void paint_it(int v, int color) {
	ans[v] = color;
	int before = 1;

	while (v < n - 1 && ask(v, v + 1) == 1) {
		ans[v + 1] = color;
		v++;
	}

	for (int i = v + 1; i < n; i++)
		if (ask(v, i) == before + 1) { before++; }
		else {
			if (ask(v + 1, i) == ask(v + 1, i - 1) + 1) ans[i] = color;
		}
	return;
}


int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	cin >> n;
	vector<vector<int> > v(n);
	ans.resize(n);

	int kek = 1;
	for (int i = 0; i < n; i++)
		if (ans[i] == 0) {
			paint_it(i, kek);
			kek++;
		}

	printf("Ready!\n%d\n", kek - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", ans[i]);
	printf("\n");
	fflush(stdout);

	return 0;
}