#define _CRT_SECURE_NO_WARNINGS
#define test 0
#include <algorithm>
#include <utility>
#include <vector>
#include <cstdio>
#include <iostream>
#include <string>
#include <time.h>
#include <set>
#include <cassert>

#define forn(i, n) for (int i = 0; i < (n); i++)
#define fornn(i, q, n) for (int i = (q); i < (n); i++)
#define times clock() * 1.0 / CLOCKS_PER_SEC
using namespace std;

typedef long long ll;

int solve();

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
	solve();

	return 0;
}

const int MAXN = 1e3 + 7;

int n;
string temp;

int interact(int l, int r);
int it = 0;

int ask(int pos1, int pos2) {
	it++;
	assert(it < 72000);
	if (!test) {
		cout << "?" << " " << pos1 + 1 << " " << pos2 + 1 << endl;
		int ans;
		cin >> ans;
		return ans;
	}
	else {
		return interact(pos1, pos2);
	}
}

int interact(int l, int r) {
	set<char> S;
	for (int i = l; i <= r; i++) {
		S.insert(temp[i]);
	}
	return S.size();
}


int solve() {
	srand(time(0));
	cin >> n;
	int k = ask(0, n - 1);
	forn(i, n) {
		temp += rand() % 2 + '0';
	}
	vector<int> G(n);
	int cur = 0;
	int cpos = 0;
	int mx = 0;
	set<int> S;
	vector<pair<int, int> > pos;
	while (cpos < n) {
		int l = cpos, r = n;
		while (r - l > 1) {
			int m = (l + r) / 2;
			if (ask(cpos, m) > 1) {
				r = m;
			}
			else {
				l = m;
			}
		}
		forn(i, pos.size()) {
			if (ask(pos[i].first, l) == ask(pos[i].first + 1, l)) cur = pos[i].second;
		}
		mx = max(mx, cur + 1);
		fornn(i, cpos, l + 1) {
			G[i] = cur;
		}
		cur = mx;
		pos.push_back(make_pair(l, cur));
		cpos = l + 1;
		S.insert(cur);
	}
	if (!test) {
		cout << "Ready!" << endl;
		cout << S.size() << endl;
		forn(i, n) {
			cout << G[i] + 1 << " ";
		}
		cout << endl;
	}
	else {
		forn(i, n) {
			cout << G[i];
		}
		cout << endl;
		cout << temp;
	}
	return 0;
}