#include <cstdio>
#include <cmath>
#include <vector>

using namespace std;

#define MAXN 3007


int table[MAXN][MAXN];
int cnt[MAXN], counts[MAXN];

int n, a[MAXN];
int free = 0;

int rq(int l, int r) {
	if (l == r-1) return 1;
	if (table[l][r] > -1) {
		return table[l][r];
	}
	printf("? %d %d\n", l+1, r);
	fflush(stdout);
	scanf("%d", &table[l][r]);
	return table[l][r];
}
void makeAns() {
	int count = 0;
	for (int i=0; i<MAXN; i++) {
		cnt[i] = 0;
	}
	for (int i=0; i<n; i++) {
		cnt[a[i]]++;
		if (cnt[a[i]] == 1) count++;
	}
	printf("Ready!\n%d\n", count);
	for (int i=0; i<n; i++) {
		printf("%d ", a[i]);
	}
	printf("\n");
	fflush(stdout);
}




int main() {
//	freopen("twopaths.in", "r", stdin);
//	freopen("twopaths.out", "w", stdout);


	scanf("%d", &n);
	for (int i=0; i<n; i++) {
		a[i] = -1;
	}
	for (int j=0; j<=n; j++) {
		for (int i=0; i<=n; i++) {
			table[j][i] = -1;
		}
	}


	a[0] = free++;
	int r;
	for (r=1; r<n; r++) {
		if (rq(0, r+1) == 1) {
			a[r] = a[0];
		} else {
			a[r] = free++;
			break;
		}
	}
	if (r == n) {
		makeAns();
		return 0;
	}
	for (int i=r+1; i<n; i++) {
		int bl = 0;
		int br = i;
		for (int e=0; e<MAXN; e++) {
			cnt[e] = counts[e] = 0;
		}

		for (int j=i-1; j>=0; j--) {
			cnt[a[j]]++;
			counts[j] = j == i-1 ? 0 : counts[j+1];
			if (cnt[a[j]] == 1) {
				counts[j]++;
			}
		}

		while (bl < br) {
			int bm = (bl + br) >> 1;
			if (rq(bm, i+1) == counts[bm]) {
				bl = bm+1;
			} else {
				br = bm;
			}
		}
		bl--;
		if (bl >= 0 && rq(bl, i+1) == counts[bl]) {
			a[i] = a[bl];
		} else {
			a[i] = free++;
		}
	}
	makeAns();
}
