#include <iostream>
#include <cstdio>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <algorithm>
#include <cassert>
#include <ctime>

using namespace std;

int out(int a, int b) {
	cout << "? " << a << ' ' << b << endl;
	int tmp;
	cin >> tmp;
	return tmp;
}

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	int n;
	cin >> n;
	vector<int> res(n + 1);
	res[1] = 1;
	int mx = 1;
	vector<int> dif_am(n);
	dif_am[1] = 1;
	for (int i = 2; i <= n; i++) {
		//int k = out(1, i);
		int l = 0, r = i;
		while (r - l > 1) {
			int m = (l + r) / 2;
			int k = out(m, i);
			if (dif_am[m] == k)
				l = m;
			else
				r = m;
		}
		int last_sim = r - 1;
		if (last_sim == 0)
			res[i] = ++mx;
		else
			res[i] = res[last_sim];
		dif_am.clear();
		dif_am.resize(n + 1);
		vector<bool> was(n + 1);
		int curdif = 0;
		for (int j = i; j >= 1; j--) {
			if (!was[res[j]])
				was[res[j]] = true, curdif++;
			dif_am[j] = curdif;
		}
	}
	cout << "Ready!" << endl;
	cout << mx << endl;
	for (int i = 1; i <= n; i++)
		cout << res[i] << ' ';
	cout << endl;
	//ASSERT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	//int AAA;
	//cin >> AAA;
    return 0;
}

