#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cassert>
#include <string>
#include <map>
#include <set>

using namespace std;

bool deb = false;

vector<int> arr;

map<pair<int, int>, int> mp;

int que(int l, int r)
{
	if (deb)
	{
		set<int> s;
		for (int i = l; i < r; ++i)
			s.insert(arr[i]);
		return s.size();
	}
	if (l == r)
		return 0;
	if (mp.count({ l, r }))
		return mp[{l, r}];
	cout << "? " << l + 1 << ' ' << r << endl;
	int x; cin >> x;
	return mp[{l, r}] = x;
}

void ready(int k, vector<int> arr)
{
	cout << "Ready!" << endl;
	cout << k << endl;
	for (auto& x : arr)
		cout << x + 1 << ' ';
	cout << endl;
}

int mque(vector<int>& ans, int l, int r)
{
	set<int> s;
	for (int i = l; i < r; ++i)
		s.insert(ans[i]);
	return s.size();
}

int main()
{
	int n; cin >> n;
	vector<int> ans;
	vector<int> last;
	int k = 0;
	for (int i = 0; i < n; ++i)
	{
		if (que(0, i + 1) != que(0, i))
		{
			ans.push_back(k++);
			continue;
		}
		int L = 0, R = i;
		while (R - L > 1)
		{
			int M = (L + R) / 2;
			if (que(M, i + 1) != mque(ans, M, i)) // true if i M...i doesn't contain i 
				R = M;
			else
				L = M;
		}
		ans.push_back(ans[L]);
	}
	assert(ans.size() == n);
	ready(k, ans);
	system("pause");
}