#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;

#define MAXN 3005

int mas[MAXN];

int dif[MAXN][MAXN];

int main()
{
	int n;
	//freopen("video.in", "r", stdin);
	//freopen("video.out", "w", stdout);
	cin >> n;
	int k = 1;
	for (int i = 0; i < n; i++)
		dif[i][i] = 1;
	for (int i = 1; i < n; i++)
	{
		int x = 0;
		cout << "? " << 1 << ' ' << i + 1 << endl;
		cout.flush();
		cin >> x;
		if (x != k)
			mas[i] = k, k++;
		else
		{
			/*set<int> temp;
			for (int j = i - 1; j >= 0; j--)
			{
				int xprev = x;
				int sizeprev = temp.size();
				temp.insert(mas[j]);
				if (sizeprev != temp.size())
				{
					cout << "? " << j + 1 << ' ' << i + 1 << endl;
					cout.flush();
					cin >> x;
				}
				if (x == 1)
					mas[i] = mas[j], j = -1;
				else
				{
					if (j != (i - 1) && sizeprev != temp.size() && x == xprev)
						mas[i] = mas[j], j = -1;
				}
			}*/
			int l = 0, r = i;
			while ((r - l) != 1)
			{
				int y;
				/*cout << "? " << (l + r) / 2 + 1 << ' ' << i << endl;
				cout.flush();
				cin >> x;*/
				set<int> tempn;
				for (int k = (l + r) / 2; k < r; k++)
					tempn.insert(mas[k]);
				x = tempn.size();
				cout << "? " << (l + r) / 2 + 1 << ' ' << i + 1 << endl;
				cout.flush();
				cin >> y;
				if (x == y)
					l = (l + r) / 2;
				else
					r = (l + r) / 2;
			}
			mas[i] = mas[l];
		}
	}
	cout << "Ready!" << endl;
	cout << k << endl;
	for (int i = 0; i < n; i++)
		cout << mas[i] + 1 << ' ';
	cout << endl;
	return 0;

}