#include <cstdio>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

const int sz = 3000;

int dna[sz], brevno[sz][sz];
int it = 0;

int out(int l, int r) {
	int res = brevno[l][r];
	if (brevno[l][r] == 0) {
		it++;
		printf("? %d %d\n", l + 1, r + 1);
		fflush(stdout);
		scanf("%d", &res);
		brevno[l][r] = res;
	}
	return res;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	int n;
	scanf("%d", &n);
	dna[0] = 1;
	int k = 1;
	int last = 1;
	for (int i = 1; i < n; i++) {
		int cur = out(0, i);
		if (cur == 1 && brevno[0][i - 1] == 1) {
			dna[i] = dna[i - 1];
		}
		else {
			if (cur > last) {
				dna[i] = ++k;
			}
			else {
				int l = 0, r = i;
				while (l + 1 < r) {
					int mid = (l + r) / 2;
					if (mid == i - 1) {
						int comp = out(mid, i);
						if (comp == 1) {
							l = mid;
						}
						else {
							r = mid;
						}
					}
					else {
						int wth = out(mid, i);
						int wtht = out(mid, i - 1);
						if (wth == wtht) {
							l = mid;
						}
						else {
							r = mid;
						}
						if (wth == 1) {
							l = i - 1;
							r = i;
						}
					}
				}
				dna[i] = dna[l];
			}
		}
		last = cur;
	}

	printf("Ready!%d\n", it);
	fflush(stdout);
	printf("%d\n", k);
	fflush(stdout);
	for (int i = 0; i < n; i++) {
		printf("%d ", dna[i]);
	}
	printf("\n");
	fflush(stdout);
	return 0;
}