#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
using namespace std;

const int MAXN = 3e3 + 111;

int n, k = 2;

vector <pair <int, int> > v;

int dif[MAXN], ans[MAXN], last[MAXN];

int get(int i, int j)
{
	printf("? %d %d\n", i + 1, j + 1);
	fflush(stdout);
	int x;
	scanf("%d", &x);
	return x;
}

bool good(int m, int id, int lst)
{
	int x = get(-v[m].first, id);
	return x == (m + 2);
}

int bin(int l, int r, int id)
{
	int n = r;
	while (l != r - 1)
	{
		int mid = (l + r) / 2;
		if (good(mid, id, n))
			l = mid;
		else
			r = mid;
	}
	/*if (r != n)
		return r;
	return l;*/
	return r;
}

void er(int pos)
{
	for (int i = pos + 1; i < v.size(); i++)
		v[i - 1] = v[i];
	v.pop_back();
}

int main()
{
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	scanf("%d", &n);
	dif[0] = 1;
	ans[0] = 1;
	last[1] = 0;
	v.push_back(make_pair(0, 1));
	for (int i = 1; i < n; i++)
	{
		dif[i] = get(0, i);
		if (dif[i] != dif[i - 1])
		{
			ans[i] = k++;
			v.push_back(make_pair(-i, ans[i]));
			continue;
		}
		else
		{
			sort(v.begin(), v.end());
			int id = bin(0, v.size() - 1, i);
			v.push_back(make_pair(-i, v[id].second));
			ans[i] = v[id].second;
			er(id);
			/*int cur = 2;
			for (set <pair <int, int> >::iterator it = st.begin(); it != st.end(); it++)
			{
				int id = -(*it).first;
				int x = get(id, i);
				if (x != cur)
				{
					st.insert(make_pair(-i, (*it).second));
					ans[i] = (*it).second;
					st.erase(it);
					break;
				}
				cur++;
			}*/
		}
	}
	printf("Ready!\n%d\n", k - 1);
	for (int i = 0; i < n; i++)
		printf("%d ", ans[i]);
	fflush(stdout);
	return 0;
}