#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <cassert>
#include <set>
#include <ctime>

using namespace std;

const int N = 3e3;

int arr[N];

#define pii pair<int, int>

vector <int> perm;

int asked[N][N];
set <int> asks[N];

//int gather(int l, int r)
//{
//  cerr << "? " << l + 1 << " " << r + 1 << endl;
//  int cnt = 1;
//  for (int i = l + 1; i <= r; ++i)
//      for (int j = i - 1; j >= l; --j)
//      {
//          if (perm[i] == perm[j])
//              break;
//          if (j == l)
//              ++cnt;
//      }
//  return cnt;
//}

int gather(int l, int r)
{
	if (l == r)
		return 1;
	if (asked[l][r] != 0)
		return asked[l][r];
	cout << "? " << l + 1 << " " << r + 1 << endl;
	int x;
	cin >> x;
	asks[l].insert(r);
	return (asked[l][r] = x);
}

vector <pair <int, pii> > v;
//color and it's [start; end] ?

const int K = 5;

int main()
{
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i)
	{
		int l = i;
		int r = n;
		while (l < r - 1)
		{
			int mid = (l + r) / 2;
			if (gather(i, mid) == 1)
				l = mid;
			else
				r = mid;
		}
		if (gather(0, i) == v.size() + 1)
		{
			v.push_back({ v.size() + 1, pii(i, l) });
			for (int a = i; a <= l; ++a)
				arr[a] = v.size();
		}
		else
		{
			int tmpl = l;
			int tmpr = r;
			int l = 0;
			int r = v.size();
			while (l < r - 1)
			{
				int mid = (l + r) / 2;
				auto it = asks[v[mid].second.first].lower_bound(i);
				if (it != asks[v[mid].second.first].end() && *it <= tmpl)
					if (gather(v[mid].second.first, *it) == v.size() - mid)
						l = mid;
					else
						r = mid;
				else
					if (gather(v[mid].second.first, tmpl) == v.size() - mid)
						l = mid;
					else
						r = mid;
			}
			int color = v[l].first;
			vector <pair <int, pii> > temp;
			int j = 0;
			for (j; j < v.size(); ++j)
				if (v[j].first == color)
					continue;
				else
					temp.push_back(v[j]);
			temp.push_back({ color, pii(i, tmpl) });
			for (int a = i; a <= tmpl; ++a)
				arr[a] = color;
			v = temp;
		}
		i = l;
	}
	cout << "Ready!" << endl;
	cout << v.size() << endl;
	for (int i = 0; i < n; ++i)
		cout << arr[i] << " ";
	cout << endl;
	return 0;
}