#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

int n, a[4000], k[4000], q, l, r, i, mark[4000], t = 1;

inline int kr() {
	t++;
	int koli = 0;
	for (int j = (r + l) / 2; j < i; j++) {
		if (mark[a[j]] != t) {
			mark[a[j]] = t;
			koli++;
		}
	}
	return koli;
}

inline bool sp() {
	cout << "? " << (r + l) / 2 << " " << i << endl;
	cin >> q;
	if (q == kr()) {
		return 0;
	}
	return 1;
}

int main() {
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> n;
	a[1] = 1;
	k[1] = 1;
	for (i = 2; i <= n; i++) {
		cout << "? 1 " << i << endl;
		cin >> q;
		if (q == k[i - 1] + 1) {
			a[i] = k[i] = k[i - 1] + 1;
			continue;
		}
		k[i] = k[i - 1];
		cout << "? " << i - 1 << " " << i << endl;
		cin >> q;
		if (q == 1) {
			a[i] = a[i - 1];
			continue;
		}
		l = 1;
		r = i - 1;
		while (r - l > 1) {
			if (sp) {
				r = (r + l) / 2;
			}
			else {
				l = (r + l) / 2;
			}
		}
		a[i] = a[l];
	}
	cout << "Ready!" << endl << k[n] << endl;
	for (i = 1; i <= n; i++) {
		cout << a[i] << " ";
	}
	return 0;
}