#include<iostream>
#include<vector>
#pragma warning (disable:4996)

using namespace std;

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

	int n; 
	cin >> n;
	vector<int> otv(n);

	vector<int> col(5000);

	otv[0] = 1;
	int y = 1;

	for (int i = 1; i < n; i++) {
		int a = 0;
		cout << "?" << " " << 0 + 1 << " " << i + 1 << endl;
		cin >> a;
		if (a > y) {
			y++;
			otv[i] = y;
		}
		else {
				int l = 0;
				int r = i;
				while (r - l > 1) {
					int t = (r + l) / 2;
					for (int j = i - 1; j >= t; j--) {
						col[otv[j]] = 1;
					}
					int k = 0;
					for (int j = 0; j <= 4000; j++) {
						if (col[j] == 1) {
							col[j] = 0;
							k++;
						}
					}
					int a = 0;
					cout << "?" << " " << t + 1 << " " << i + 1 << endl;
					cin >> a;
					if (a == k)
						l = t;
					else
						r = t;
				}
				if (r == i - 1) {
					cout << "?" << " " << i << " " << i + 1 << endl;
					int a;
					cin >> a;
					if (a == 1)
						l = r;
				} 
				otv[i] = otv[l];
			}
	}

	cout << "Ready!" << endl;
	int k = 0;
	for (int i = 0; i < n; i++) {
		col[otv[i]] = 1;
	}
	for (int i = 0; i <= 4000; i++) {
		if (col[i] == 1)
			k++;
	}
	cout << k << endl;

	for (int i = 0; i < n; i++) {
		cout << otv[i] << " ";
	}
	//system("PAUSE");
	return 0;
}