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

using namespace std;

const int sz = 4000;

int dna[sz];

void out(int l, int r) {
	printf("? %d %d\n", 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;
	for (int i = 1; i < n; i++) {
		int cur;
		out(0, i);
		scanf("%d", &cur);
		if (cur > last) {
			dna[i] = ++k;
		}
		else {
			int l = 0, r = i;
			while (l + 1 < r) {
				int mid = (l + r) / 2;
				out(mid, i);
				int wth;
				scanf("%d", &wth);
				out(mid, i - 1);
				int wtht;
				scanf("%d", &wtht);
				if (wth == wtht) {
					l = mid;
				}
				else {
					r = mid;
				}
			}
			dna[i] = dna[l];
		}
		last = cur;
	}

	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;
}

