#define _CRT_SECURE_NO_WARNINGS

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

using namespace std;

int solve();

#define TASK "video"

typedef long long ll;

#define forn(i, n) for (int i = 0; i < n; i++)
#define fornn(i, q, n) for (int i = q; i < n; i++)
#define all(v) v.begin(), v.end()

int main() {
#ifdef KAZAN
	//freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
#else
	//freopen(TASK".in", "r", stdin), freopen(TASK".out", "w", stdout);
#endif
	solve();
	return 0;
}

int K;
int n;

map<pair<int, int>, int > M;

int it;

int ask(int l, int r) {
	if (l == r)
		return 1;

	if (M.count(make_pair(l, r)))
		return M[make_pair(l, r)];

	it++;
	if (it > 70000)
		assert(0);

	cout << "? " << l << " " << r << endl;

	int t;
	cin >> t;

	return M[make_pair(l, r)] = t;
}
void out(vector<int> A) {
	cout << "Ready!" << endl;
	cout << K << endl;

	forn(i, n)
		cout << A[i + 1] << " ";
	cout << endl;
}

int solve() {
	cin >> n;

	K = ask(1, n);

	vector<int> A(n + 1);

	int cur = 1;


	/*vector<int> T(n);

	forn(i, n) {
		T[i] = ask(i + 1, n);
	}

	vector<pair<int, int> > H;

	fornn(i, 1, n) {
		if (T[i] != T[i - 1]) {
			A[i] = cur;

			H.push_back(make_pair(i, cur));

			cur++;
			if (cur > K)
				cur -= K;
		}
	}*/

	A[n] = cur++;

	/*fornn(i, 1, n) {
		if (A[i] == 0) {

			int t = 0;

			for (int j = 0; j < H.size(); j++) {
				if (H[j].first <= i)
					continue;
				t++;

				if (ask(i, H[j].first) == t) {
					A[i] = H[j].second;
					break;
				}
			}
		}
	}*/

	for (int i = n - 1; i > 0; i--) {

		int pr = -1;

		for (int j = i; j <= n; j++) {
			int t = ask(i, j);

			if (t == pr) {
				A[i] = A[j];
				break;
			}
			pr = t;
		}

		if (A[i] == 0) {
			A[i] = cur;
			cur++;
			if (cur > K)
				cur -= K;
		}
	}

	out(A);
	return 0;
}