#include <iostream>
#include <vector>
using namespace std;


int main() { //fflush в конце
	int n;
	cin >> n;
	vector<int> num(n + 1, 0);
	vector<int> dif(n + 1, 0);
	num[1] = 1;
	dif[1] = 1;
	int sum = 1;
	for (int i = 2; i <= n; i++) {
		cout << "? " << 1 << " " << i << endl;
		fflush(stdout);
		int a;
		cin >> a;
		if (a > sum) {
			sum++;
			num[i] = sum;
			for (int j = 1; j <= i; j++) {
				dif[j]++;
			}
		} else {
			if (dif[1] == 1) {
				num[i] = 1;
				dif[i] = 1;
				continue;
			}
			int l = 1, r = i;
			while (r - l > 1) {
				int mid = (l + r) / 2;
				cout << "? " << mid << " " << i << endl;
				fflush(stdout);
				int b;
				cin >> b;
				if (b == dif[mid]) {
					l = mid;
				} else {
					r = mid;
				}
			}
			num[i] = num[l];
			for (int j = r; j <= i; j++) {
				dif[j]++;
			}
		}
	}


	cout << "Ready!" << endl;
	cout << sum << endl;
	for (int i = 1; i <= n; i++) {
		cout << num[i] << " ";
	}
	return 0;
}