#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <unordered_map>
#include <algorithm>
using namespace std;

int s[4000];
int qs[3100][3100];
int z = 1;
int n;

int query(int L, int R)
{
	if (L == R)
		return 1;
	if (qs[L][R])
		return qs[L][R];
	cout << "? " << L << ' ' << R << endl;
	cout.flush();
	int x; cin >> x;
	qs[L][R] = x;
	return x;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin >> n;
	
	s[1] = z++;
	/*for (int i = 2; i <= n; ++i)
	{
		for (int j = i - 1; j > 0; --j)
			if (query(j, i - 1) == query(j + 1, i) && query(j, i - 1) == query(j, i))
			{
				s[i] = s[j];
				break;
			}
		if (s[i] == 0)
			s[i] = z++;
	}*/

	unordered_map < int, int > st;
	for (int i = 2; i <= n; ++i)
	{
		int L = 0, R = i, M;
		st.clear();
		int cur = i;
		while (L < R - 1)
		{
			M = (L + R) / 2;
			//int q1 = query(M, i - 1);
			if (M < cur)
			{
				for (int j = M; j < cur; ++j)
					st[s[j]]++;
				cur = M;
			}
			else if (M > cur)
			{
				while (cur < M)
				{
					st[s[cur]]--;
					if (st[s[cur]] == 0)
						st.erase(s[cur]);
					cur++;
				}
			}
			int q1 = st.size();
			int q2 = query(M, i);
			if (q1 == q2)
				L = M;
			else
				R = M;
		}
		if (L == 0)
			s[i] = z++;
		else
			s[i] = s[L];
	}

	cout << "Ready!" << endl;
	cout << z - 1 << endl;
	for (int i = 1; i <= n; ++i)
		cout << s[i] << ' ';
	cout << endl;
	cout.flush();
	return 0;
}