#include <string>
#include <map>
#include <set>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

#ifdef _DEBUG
#include <iostream>
//ifstream cin("input.txt");
//ofstream cout("output.txt");
#else
#include <iostream>
//ifstream cin("video.in");
//ofstream cout("video.out");
#endif

int x;
int a[3000];
bool us[3000];
bool u[3000];

vector < int > g;

void dfs(int v, int color){
	u[v] = true;
	a[v] = color;
	if (g[v] != -1)
		dfs(g[v], color);
}

int main() {
	cin >> x;
	int ans = 0;
	cout << "? 1 " << x << endl;
	cout.flush();
	cin >> ans;

	int c = 2;

	if (ans <= 10) {
		a[0] = 1;
		for (int i = 0; i < x; i++) {
			if (a[i] == 0)
				a[i] = c++;
			bool p = false;
				for (int j = i + 1; j < x; j++) {
					if (!us[j] && !p) {
						int res1 = 1;
						if (i + 2 != j + 1) {
							cout << "? " << i + 2 << ' ' << j + 1 << endl;
							cout.flush();
							cin >> res1;
						}
						int res2 = 0;
						cout << "? " << i + 1 << ' ' << j + 1 << endl;
						cout.flush();
						cin >> res2;

						if (res1 == res2 && !p) {
							a[j] = a[i];
							us[j] = true;
							p = true;
							break;
						}
					}
				}
		}

		cout << "Ready!" << endl;
		cout.flush();
		cout << ans << endl;
		cout.flush();
		for (int i = 0; i < x; i++) {
			if (a[i] == 0)
				return 1;
			cout << a[i] << ' ';
		}
		cout << endl;
		cout.flush();
#ifdef _DEBUG
		system("pause");
#endif
		return 0;
	}

	int q = 1;

	a[0] = 1;

	for (int i = 0; i < x - 1; i++) {
		if (a[i] == 0)
			a[i] = c++;
		int l = i;
		int r = x;
		while(l != r - 1) {
			int j = l + r >> 1;
			int res1 = 1;
			if (i + 2 != j + 1) {
				cout << "? " << i + 2 << ' ' << j + 1 << endl;
				q++;
				cout.flush();
				cin >> res1;
			}
			int res2 = 0;
			cout << "? " << i + 1 << ' ' << j + 1 << endl;
			q++;
			cout.flush();
			cin >> res2;
			if (res1 == res2)
				r = j;
			else
				l = j;
		}
		a[r] = a[i];
	}

	if (a[x - 1] == 0)
		a[x - 1] = c++;
	cout << "Ready!" << endl;
	cout.flush();
	cout << ans << endl;
	cout.flush();
	int mx = 0;
	for (int i = 0; i < x; i++) {
		cout << a[i] << ' ';
	}
	cout << endl;
	cout.flush();
	

	#ifdef _DEBUG
	system("pause");
	#endif
}