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

int main() {
	int n;
	cin >> n;
	vector <pair<int, int> > last_element(1, make_pair(0, 1));
	int ans[n];
	ans[0] = 1;
	int diff_elems = 1;
	int prev = 1;
	for (int i = 1; i < n; i++) {
		cout << "? " << 1 << " " << i + 1 << endl;
		int response;
		cin >> response;
		if (response != prev) {
			ans[i] = diff_elems + 1;
			diff_elems++;
			prev = response;
		} else {
			int exk = 0;
			int exnok = last_element.size();
			while (exk + 1 < exnok) {
				int mid = (exk + exnok) / 2;
				int pos_of_st = last_element[mid].first;
				cout << "? " << pos_of_st + 1 << " " << i + 1 << endl;
				int num_of_diff = last_element.size() - mid;
				cin >> response;
				if (response == num_of_diff) {
					exk = mid;
				} else {
					exnok = mid;
				}
			}
			int val = last_element[exk].second;
			last_element.erase(last_element.begin() + exk);
			last_element.push_back(make_pair(i, val));
			ans[i] = val;
		}
	}
	cout << "Ready!\n" << diff_elems << endl; 
	for (int i = 0; i < n; i++) {
		cout << ans[i] << " ";
	}
	return 0;
}