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

using namespace std;

const int sz = 2e3;

int counter[sz], know[sz];
int dna[sz];

void out(int l, int r) {
	printf("? %d %d", l + 1, r + 1);
	fflush(stdout);
}

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;
	know[1] = 1;
	for (int i = 1; i < n; i++) {
		int cur;
		out(0, i);
		scanf("%d", &cur);
		if (cur > last) {
			dna[i] = ++k;
		}
		else {
			int curlast = cur;
			for (int j = 0; j <= k; j++) {
				counter[j] = 0;
			}
			bool flag = true;
			for (int j = 1; j < i; j++) {
				int curcur;
				out(j, i);
				scanf("%d", &curcur);
				counter[dna[j - 1]]++;
				if (counter[dna[j - 1]] == know[dna[j - 1]] && curcur == curlast) {
					dna[i] = dna[j - 1];
					flag = false;
				}
				curlast = curcur;
			}
			if (flag) {
				dna[i] = dna[i - 1];
			}
		}
		last = cur;
		know[dna[i]]++;
	}

	printf("Ready!\n");
	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;
}

