#include <stdio.h>
#include <vector>
#include <iostream>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

#pragma warning (disable:4996)

#define mlp make_pair
#define ll long long int
#define x1 first
#define y1 second

int n, ans[3007], s[3007], now = 1;

void sol() {
	int i, j, l, r, m, a, b;
	cin >> n;
	ans[0] = 1;
	now++;
	for (i = 1; i < n; i++) {
		cout << "?" << 1 << " " << i << endl;
		cin >> a;
		cout << "?" << 1 << " " << i + 1 << endl;
		cin >> b;
		if (a == b) {
			l = -1;
			r = i;
			while (r - l > 1) {
				m = (l + r) / 2;
				cout << "?" << m + 1 << " " << i << endl;
				cin >> a;
				cout << "?" << m + 2 << " " << i + 1 << endl;
				cin >> b;
				if (a - b == 0) {
					l = m;
				}
				else {
					r = m;
				}
			}
			ans[i] = ans[r - 1];
		}
		else {
			ans[i] = now;
			now++;
		}
	}
	cout << "Ready!" << endl << now - 1 << endl;
	for (i = 0; i < n; i++) {
		cout << ans[i];
		if (i != n - 1)cout << " ";
	}
	i = 1;
}

int main() {


	sol();

}