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

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 = 1; i < n; i++)
	{
		int x = 0;
		cout << "? " << 1 << ' ' << i + 1 << endl;
		cout.flush();
		cin >> x;
		if (x != k)
			mas[i] = k, k++;
		else
		{
			for (int j = i - 1; j >= 0; j--)
			{
				int xprev = x;
				cout << "? " << j + 1 << ' ' << i + 1 << endl;
				cout.flush();
				cin >> x;
				if (x == 1)
					mas[i] = mas[j], j = -1;
				else
				{
					if (j != (i - 1) && mas[j] != mas[j + 1] && x == xprev)
						mas[i] = mas[j], j = -1;
				}
			}
		}
	}
	cout << "Ready!" << endl;
	cout << k << endl;
	for (int i = 0; i < n; i++)
		cout << mas[i] + 1 << ' ';
	cout << endl;
	return 0;
}