#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<vector>
#include<string>
#include<algorithm>

#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 <vector <int> > a(0,vector <int> (2));
	vector <int> pr(2);
	a.push_back(pr);
	int cl = 1;
	vector <int> ans(n);
	for (int i = 1; i < n; i++) {
		cout << "? " << 1 << " " << i + 1 << endl;
		cin >> ans[i];
		if (ans[i] != ans[i - 1]) {
			pr[0] = cl;
			pr[1] = i;
			ans[i] = cl;
			a.push_back(pr);
			cl++;
		}
		else {
			int l = 0; int r = cl - 1;
			while (r - l > 1) {
				int m = (r + l) / 2;
				cout << "? " << a[m][1] + 1 << " " << i + 1 << " " << endl;
				int s;
				cin >> s;
				if (s == cl - m - 1)
					r = m;
				else
					l = m;
			}
			for (int j = 0; j < ans.size() - 1; j++)
				if (i >= l)
					a[j] = a[j + 1];
			a[ans.size() - 1][0] = ans[l];
			a[ans.size() - 1][1] = i;
			ans[i] = ans[l];
		}
		}
	cout << "Ready!" << "\n";
	cout << a.size() << "\n";
	for (int i = 0; i < n; i++)
		cout << ans[i] + 1 << " ";
	cout << endl;
	return 0;
}