#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> arr(n);
	vector<int> d(n);
	d[0] = 1;
	arr[0] = 0;
	int k = 0;
	for (int i = 1; i < n; i++) {
		int a;
		cout << "? " << 1 << ' ' << i + 1 << endl;
		cin >> a;
		int l = 0, r = i;
		if (a != d[0]) { l = -1; r = -1; }
		while (l != r) {
			int m = (l + r + 1) / 2;
			cout << "? " << m + 1 << ' ' << i + 1 << endl;
			cin >> a;
			if (d[m] == a) { l = m; }
			else { r = m - 1; }
		}
		for (int j = l + 1; j <= i; j++) {
			d[j]++;
		}
		if (l == -1) { k++; arr[i] = k; }
		else { arr[i] = arr[l]; }
	}
	cout << "Ready!" << endl;
	cout << k + 1 << endl;
	for (int i = 0; i < n; i++) {
		cout << arr[i] + 1 << ' ';
	}
	cout << endl;
	return 0;
}