#include <iostream>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <cstdlib>

#define ll long long
#define ld long double
#define mp make_pair
#define sz(x) (int) x.size()

using namespace std;

#define TASKNAME ""

const int N = 3005;

int n;
vector<int> g[N];
int val[N];

int query(int i, int j) {
	cout << i + 1 << " " << j + 1 << endl;
	int ans;
	cin >> ans;
	return ans;
}

int k;

void dfs(int v) {
	val[v] = k;
	for (int u : g[v]) {
		if (val[u] == -1) dfs(u);
	}
}

int main() {
	ios::sync_with_stdio(false);
	cout.tie(0);
	cin.tie(0);

#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#else
	if (TASKNAME != "") {
		freopen(TASKNAME ".in", "r", stdin);
		freopen(TASKNAME ".out", "w", stdout);
	}
#endif

	cin >> n;

	for (int l = 0; l < n - 1; l++) {
		for (int r = l + 1; r < n; r++) {
			int q = query(l, r);
			if (q != r - l + 1) {
				int t = l + 1;
				while (query(t, r) != r - t + 1) {
					t++;
				}
				g[t].push_back(r);
				g[r].push_back(t);
				break;
			}
		}
	}

	fill(val, val + n, -1);

	k = 0;
	for (int i = 0; i < n; i++) {
		if (val[i] == -1) {
			dfs(i);
			k++;
		}
	}

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

#ifdef _DEBUG
	while (1);
#endif

	return 0;
}