#include <iostream>
#include <algorithm>

using namespace std;

const int SIZE = 3000;

int a[SIZE], k = 0;
int p[SIZE][SIZE];
pair<int, int> last[SIZE];

int ask(int i, int j)
{
	if (p[i][j] == 0) {
		printf("? %d %d\n", i + 1, j + 1);
		fflush(stdout);
		scanf("%d", &p[i][j]);
	}

	return p[i][j];
}

int main()
{
#ifdef _CONSOLE
	//	freopen("input.txt", "r", stdin);
#else
	//	freopen("video.in", "r", stdin);
	//	freopen("video.out", "w", stdout);
#endif

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)
		p[i][i] = 1;

	a[0] = k++;
	last[0] = make_pair(0, 0);

	for (int i = 1; i < n; i++) {
		if (ask(0, i) > ask(0, i - 1)) {
			a[i] = k;
			last[k] = make_pair(i, k);
			sort(last, last + ++k);
		}
		else {
			int l = 0, r = k, m;

			while (l < r - 1) {
				m = (l + r) / 2;

				if (ask(last[m].first, i) == ask(last[m].first, i - 1))
					l = m;
				else
					r = m;
			}

			a[i] = last[l].second;
			last[l].first = i;
			sort(last, last + k);
		}
	}

	printf("Ready!\n%d\n", k);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i] + 1);
	fflush(stdout);
}