#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <memory.h>
#define mp make_pair
using namespace std;

const int MAXN = 3001;
bool w[MAXN];

int a[MAXN];
int b[MAXN];







int main()
{
	//freopen("twopaths.in", "r", stdin);
	//freopen("twopaths.out", "w", stdout);
	int n;
	cin >> n;
	int cur = 0;
	for (int i = 1; i <= n; i++)
	{
		memset(w, 0, sizeof(w));
		b[i] = 0;
		for (int j = i - 1; j >= 1; j--)
		{
			b[j] = b[j + 1];
			if (!w[a[j]]) w[a[j]] = true, b[j]++;
		}
		int lg = 1, rg = i;
		while (lg < rg)
		{
			int md = (lg + rg) / 2;
			cout << "? " << md << " " << i << endl;
			cout.flush();
			int f;
			cin >> f;
			if (f == b[md])
			{
				lg = md + 1;
			}
			else rg = md;
		}
		if (lg == 1) a[i] = ++cur;
		else a[i] = a[lg - 1];
	}
	cout << "Ready!" << endl << cur << endl;
	for (int i = 1; i <= n; i++) cout << a[i] << " ";
	cout << endl;
	return 0;
}