#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(4000);

	otv[0] = 1;
	col[1] = 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 - 1;
			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 < 3000; 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;
			}
			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 < 3000; i++) {
		if (col[i] == 1)
			k++;
	}
	cout << k << endl;

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