#include <iostream>
#include <map>
#include <set>
#include <deque>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <iterator>
#include <ctime>
#include <cmath>
#include <fstream>
#include <stdio.h>
#include <assert.h>

using namespace std;

const int MAXN = 3000;
int ans[MAXN + 1];

void solve(int l, int r) {
	map<int, int> calc;
	if (r - l + 1 == 1)
		ans[l] = 1;
	else if (r - l + 1 == 2) {
		cout << "? " << l << " " << r << endl;
		int res;
		cin >> res;
		if (res == 2)
			ans[l] = 1, ans[r] = 2;
		else
			ans[l] = ans[r] = 1;
	}
	else {
		int m = (l + r) / 2;
		solve(l, m);
		solve(m + 1, r);
		cout << "? " << l << " " << m << endl;
		int temp;
		cin >> temp;
		int clc = 0;
		for (int i = m + 1; i <= r; i++) {
			if (calc[ans[i]]) {
				ans[i] = calc[ans[i]];
				continue;
			}
			bool f = false;
			for (int j = m; j >= l; j--) {
				int res1, res2;
				cout << "? " << j << " " << i << endl;
				cin >> res1;
				cout << "? " << j << " " << i - 1 << endl;
				cin >> res2;
				if (res1 == res2) {
					calc[ans[i]] = ans[j];
					ans[i] = ans[j];
					f = true;
					break;
				}
			}
			if (!f) {
				int temp = ans[i];
				ans[i] = ans[l];
				for (int j = l; j <= i - 1; j++)
					ans[i] = max(ans[i], ans[j]);
				ans[i]++;
				calc[temp] = ans[i];
			}
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");

	int n;
	cin >> n;
	solve(1, n);
	cout << "? " << 1 << " " << n << endl;
	int temp;
	cin >> temp;
	map<int, int> res;
	for (int i = 1; i <= n; i++)
		res[ans[i]] = 1;
	assert(temp == (int)res.size());
	cout << "Ready!" << endl;
	cout << (int)res.size() << endl;
	for (int i = 1; i <= n; i++) {
		cout << ans[i] << " ";
	}
	cout << endl;
	return 0;
}