#include <iostream>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <iterator>
#include <string>
#include <unordered_set>
#include <unordered_map>
#pragma warning(disable: 4996)
typedef long long ll;
typedef long double ld;
using namespace std;

const int SZ = 1e5;
const int INF = 1e9;

unordered_set<int> d;
int a[SZ];

int guos(int l, int r) {
	d.clear();
	for (int i = l; i < r; i++)
		d.insert(a[i]);
	return d.size();
}

int main() {
#ifdef _DEBUG
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#else
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	srand(654536633);

	int n;
	cin >> n;
	
	int taken = 0, rq;
	for (int i = 0; i < n; i++) {
		cout << "? 1 " << i + 1 << endl;
		cin >> rq;
		if (rq == guos(0, i) + 1)
			a[i] = ++taken;
		else {
			int l = 0, r = i, it = 11;
			while (it--) {
				int m = (l + r) >> 1;
				cout << "? " << m + 1 << " " << i + 1 << endl;
				cin >> rq;
				if (rq == guos(m, i))
					l = m + 1;
				else
					r = m;
			}
			a[i] = a[l - 1];
		}
	}

	cout << "Ready!\n" << taken << "\n";
	for (int i = 0; i < n; i++)
		cout << a[i] << " ";
	cout << endl;
	
	return 0;
}