#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:256000000")

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cassert>

using namespace std;

typedef long long ll;

#define TASK "video"
#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define for1(i, n) for(int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define pk push_back
#define mk make_pair

const int MAXN = (int)3000 + 7;

int solve();

int main() {
#ifdef _DEBUG
	//freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout);
#else
	//freopen(TASK".in", "r", stdin), freopen(TASK".out", "w", stdout);
#endif
	return solve();
}

int d[MAXN][MAXN];
int ans[MAXN], pref[MAXN];

int get(int i, int j) {
	printf("? %d %d\n", i, j);
	fflush(stdout);
	int x;
	cin >> x;
	return x;
}

int solve() {
	int n;
	cin >> n;

	int k = 0;
	for1(i, n) {
		pref[i] = get(1, i);
		if (pref[i] > pref[i - 1]) {
			ans[i] = ++k;
			continue;
		}
		int pd = -1;
		for (int j = 1; j <= i - 1; j++) {
			int d = get(j, i);
			if (d == pd) {
				int ind = -1;
				for (int w = j + 1; w < i; w++) {
					if (ans[j] == ans[w]) {
						ind = w;
						break;
					}
				}
				if (ind == -1) {
					ans[i] = ans[j];
					break;
				}
			}

			pd = d;
		}
	}

	printf("Ready!\n%d\n", k);
	for1(i, n) {
		printf("%d ", ans[i]);
	}
	return 0;
}