#include <bits/stdc++.h>
using namespace std;

int n;

int ans[3030];
int last;

int asks[3030][3030];

int ask(int l, int r)
{
	if (asks[l][r] != 0)
		return asks[l][r];
	printf("? %d %d\n", l + 1, r);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return asks[l][r] = x;
}

int diff(int l, int r)
{
	set <int> q;
	for (int i = l; i < r; ++i)
		q.insert(ans[i]);

	return (int)q.size();
}

int mex(int l, int r)
{
	set <int> q;
	for (int i = l; i < r; ++i)
		q.insert(ans[i]);
	for (int i = 0; ; ++i)
		if (q.find(i) == q.end())
			return i;
}

int main()
{
	scanf("%d", &n);

	int lastl = 1;


	for (int len = 2; len <= n;)
	{
		for (int i = 0; i + len <= n; ++i)
		{
			int k = ask(i, i + len);
			int d = diff(i, i + len);
			if (k == d)
				continue;
			if (len == 2)
			{
				ans[i + len - 1] ^= 1;
				last = 1;
				continue;
			}
			if (i == 0)
			{
				int dif = diff(0, lastl + 1);
				for (int j = lastl + 1; j <= len; ++j)
				{
					int x = ask(0, j);
					if (x != dif)
					{
						int ind = j - 1;
						int val = mex(0, j);
						for (int k = j; k < n && (k - ind) <= lastl; ++k)
							if (ans[k] == ans[j - 1])
							{
								ans[k] = val;
								ind = k;
							}
						ans[j - 1] = val;
						++dif;
						last = max(last, val);
					}
					if (x == k)
						break;
				}
				continue;
			}
			int ind = i + len - 1;
			int val = mex(i, i + len);
			for (int k = ind + 1; k < n && (k - ind) <= lastl; ++k)
				if (ans[k] == ans[i + len - 1])
				{
					ans[k] = val;
					ind = k;
				}
			ans[i + len - 1] = val;
			last = max(last, val);
		}
		// for (int i = 0; i < n; ++i)
		// 	printf("%d ", ans[i]);
		// printf("\n");
		if (len == n)
			break;
		lastl = len;
		len *= 2;
		if (len > n)
			len = n;
	}

	printf("Ready!\n%d\n", last + 1);

	for (int i = 0; i < n; ++i)
		printf("%d ", ans[i] + 1);


	return 0;
}