#define _ijps 01
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cmath>
#include <algorithm>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <set>
#include <vector>
#include <time.h>

using namespace std;

#define name ""
typedef long long ll;
#define forn(i, n) for(int i = 0; i < n; i++)
#define fornn(i, a, n) for(int i = a; i < n; i++)
#define mk make_pair

const int dd = 2e3 + 7;
const int infi = 1e9 + 7;
const ll inf = 1e18 + 7;

int n;

map<pair<int, int>, int> F;

vector<int> R;

int get(int l, int r) {
	if (F.count(mk(l, r))) {
		return F[mk(l, r)];
	}
	if (r < l)
		return 0;

	int t;
	if (_ijps) {
		cout << "? " << l << ' ' << r << endl;
		cin >> t;
	}
	else {
		set<int> T;
		for (int i = l - 1; i < r; i++) {
			T.insert(R[i]);
		}
		t = T.size();
	}
	return F[mk(l, r)] = t;
}

vector<int> W;

void gg(vector<int> W, int k) {
	if (_ijps) {
		cout << "Ready!" << endl;
		cout << k << endl;
		forn(i, W.size()) {
			cout << W[i] + 1 << ' ';
		}
		cout << endl;
	}
	else {
		vector<int> T;
		map<int, int> G;
		int te = 0;
		forn(i, n) {
			if(!G.count(R[i])) {
				G[R[i]] = te++;
			}
			T.push_back(G[R[i]]);
		}

		if (k != G.size() || W != T) {
			cerr << "NO";
			while (1) {
				k++;
			}
		}
	}
}

int main() {
	if (_ijps) {
		//freopen("input.txt", "r", stdin);
		//freopen("output.txt", "w", stdout);
	}
	else {
		//freopen(name".in", "r", stdin);
		//freopen(name".out", "w", stdout);
	}
	srand(time(0));
	if (_ijps) {
		cin >> n;
	}
	else {
		n = 50;
		forn(i, n) {
			R.push_back(rand() % 25);
		}
		forn(i, n) {
			cerr << R[i] << ' ';
		}
		cerr << '\n';
	}
	W.resize(n);
	vector<int> G;
	int t = 0;
	forn(i, n) {
		int g = get(1, i + 1);
		if (g != t) {
			G.push_back(t);
			W[i] = t;
			t = g;
		}
		else {
			set<int> F;
			vector<int> E;
			for (int j = i - 1; j >= 0; j--) {
				if (!F.count(W[j])) {
					E.push_back(j);
					F.insert(W[j]);
				}
			}
			int l = -1, r = E.size() - 1;
			while (r - l > 1) {
				int s = (l + r) / 2;
				int g = get(E[s] + 1, i + 1) - 1 - s;
				if (g <= 0) {
					r = s;
				}
				else {
					l = s;
				}
			}
			W[i] = W[E[r]];
		}
	}
	gg(W, G.size());
}