#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <set>
using namespace std;

typedef long long ll;
typedef vector < ll > vll;


vll a;
vll cnt;


ll query(ll l, ll r) {
	cout << "? " << l + 1 << ' ' << r + 1 << '\n';
	cout.flush();
	ll ans;
	cin >> ans;
	return ans;
}


int main() {
	ll n;
	ll k = 0;
	cin >> n;
	a.resize(n);
	a[0] = ++k;
	cnt.resize(0, 1);
	for (ll i = 1; i != n; ++i) {


		cnt.resize(i);
		cnt[i - 1] = 1;
		set < ll > s;
		for (ll j = i - 2; j != -1; --j) {
			ll size = s.size();
			s.insert(a[i]);
			if (s.size() > size)
				cnt[j] = cnt[j + 1] + 1;
			else
				cnt[j] = cnt[j + 1];
		}


		if (query(0, i) != cnt[0])
			a[i] = ++k;
		else {
			ll l = 0, r = i - 1;
			while (r - l > 1) {
				ll m = (r + l) / 2;
				if (query(m, i) != cnt[m])
					r = m;
				else
					l = m;
			}
			if (query(r, i) == cnt[r])
				l = r;
			a[i] = a[l];
		}
		
	}
	cout << "Ready!\n";
	cout << k << '\n';
	for (auto i : a)
		cout << i << ' ';
	cout << '\n';
	//system("pause");
	return 0;
}