#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <numeric>
#include <set>
#include <map>
#include <string>
#include <cassert>
#include <memory.h>
#include <iomanip>

using namespace std;

#define int long long
#define sz(a) (int)(a.size())

int n;
int k;
int cur = 1;
int a[3333];
int t;
int meme[3333][3333];
int cnt;
int cc[3333];
int cc2[3333];

int count(int l, int r)
{
	set<int> have;
	for (int i = l; i <= r; ++i)
	{
		have.insert(a[i]);
	}
	return sz(have);
}

int query(int l, int r, int ptr)
{
	if (l > r)
		return 0;
	if (meme[l][r])
		return meme[l][r];
	if (l == r)
		return 1;
	if (ptr > r)
		return count(l, r);
	cout << '?' << ' ' << l << ' ' << r << '\n';
	cout.flush();
	++cnt;
	int res;
	cin >> res;
	meme[l][r] = res;
	return res;
}

void solve2()
{
	a[1] = cur++;
	int ptr = 2;
	int t = 1;
	cc[1] = 1;
	while (ptr <= n)
	{
		int q = query(1, ptr, ptr);
		if (q == t + 1)
		{
			a[ptr++] = cur++;
			++t;
			cc[a[ptr - 1]]++;
		}
		else
		{
			for (int i = 1; i < cur; ++i)
			{
				cc2[i] = cc[i];
			}
			for (int i = 1; i < ptr; ++i)
			{
				cc2[a[i]]--;
				if (cc2[a[i]] == 0)
				{
					if (count(i, ptr - 1) == query(i + 1, ptr, ptr))
					{
						a[ptr++] = a[i];
						cc[a[ptr - 1]]++;
						break;
					}
				}
			}
		}
	}
	cout << "Ready!\n";
	cout << cur - 1 << '\n';
	for (int i = 1; i <= n; ++i)
	{
		cout << a[i] << ' ';
	}
}
signed main()
{
	//ios_base::sync_with_stdio(0), cin.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	/*freopen("video.in", "r", stdin);
	freopen("video.out", "w", stdout);
	*/
	cin >> n;
	solve2();
	return 0;
}