#include <stdio.h>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
#include <math.h>
#include <string>

using namespace std;

#pragma warning(disable:4996)

#define x first
#define y second
#define mp make_pair
#define pb push_back

typedef long long ll;

int ask(int l, int r) {
	printf("? %d %d\n", l + 1, r + 1);
	fflush(stdout);
	int ans;
	scanf("%d", &ans);
	return ans;
}

int a[3030];

int build(int l, int r) {
	if (r - l == 1) {
		a[l] = 1;
		return 1;
	}
	int m = (l + r) / 2;
	int L = build(l, m);
	vector<int> last(L);
	for (int i = l; i < m; ++i) {
		last[a[i] - 1] = i;
	}
	for (int i = m; i < r; ++i) {
		int le = -1, re = last.size();
		while (re - le > 1) {
			int c = (le + re) / 2;
			if (ask(last[c], i) == last.size() - c + 1) {
				re = c;
			}
			else {
				le = c;
			}
		}
		if (re == 0) {
			a[i] = last.size() + 1;
			last.pb(i);
		}
		else {
			a[i] = a[last[le]];
		}
		last[a[i] - 1] = i;
	}
	return last.size();
}

void solve() {
	int n, ans;
	scanf("%d", &n);
	ans = build(0, n);
	printf("Ready!\n");
	fflush(stdout);
	printf("%d\n", ans);
	fflush(stdout);
	for (int i = 0; i < n; ++i) {
		printf("%d ", a[i]);
	}
	fflush(stdout);
	cerr << ans << endl;
	for (int i = 0; i < n; ++i) {
		cerr << a[i] << ' ';
	}
	cerr << endl;
}

int main() {
#pragma comment(linker, "/STACK:536870912")
//#ifdef _DEBUG
//	freopen("input.txt", "rt", stdin);
//	freopen("output.txt", "wt", stdout);
//#else
//	freopen("video.in", "rt", stdin);
//	freopen("video.out", "wt", stdout);
//#endif
//	freopen("output.txt", "wt", stderr);
	solve();
	return 0;
}
