#define _CRT_SECURE_NO_DEPRECATE
#include <iostream>
#include <algorithm>


typedef long long ll;


using namespace std;


#define TASK "video"


int d[3005];


int num(int i, int j) {
	cout << "? " << i << ' ' << j << endl;
	int ans;
	cin >> ans;
	return ans;
}


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 // _DEBUG

	int n;
	cin >> n;
	int a;
	int k;
	k = num(1, n);
	int tc = 0;
	d[1] = 1;
	int prevans = num(1, 2);
	if (prevans == 1) {
		d[2] = 1;
		tc = 2;
	}
	else {
		d[2] = 2;
		tc = 3;
	}
	for (int i = 3; i <= n; i++) {
		int tans = num(1, i);
		if (tans == prevans) {
			int prevqans = 1;
			for (int j = i - 1; j >= 1; j--) {
				int qans = num(j, i);
				if (qans == prevqans) {
					d[i] = d[j];
					break;
				}
				prevqans = qans;
			}
		}
		else {
			d[i] = tc++;
		}
		prevans = tans;
	}
	cout << "Ready!\n";
	cout << k << '\n';
	for (int i = 1; i <= n; i++) {
		cout << d[i] << ' ';
	}
	cout << endl;
#ifdef _DEBUG
	system("pause");
#endif // _DEBUG

}