#include <bits/stdc++.h>
#define forn(i, n) for (int i = 0; i < n; i++)
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
using namespace std;
typedef long long ll;

const int MAXN = 100500;

int arr[MAXN];
int n;
int k;

int ask(int l, int r)
{
	if (l > r)
		return 0;
	int x;
	cout << "? " << l + 1 << ' ' << r + 1 << endl;
	cin >> x;
	return x;

}

int main()
{
	cin >> n;
	
	forn(i, n)
	{
		int am = ask(0, i);
		assert(am == k + 1 || am == k);

		if (am == k + 1)
		{
			arr[i] = ++k;
		}
		else
		{
			int bl = 0;
			int br = i + 1;

			while (br - bl > 1)
			{
				int bm = (bl + br) / 2; 
				
				if (ask(bm, i) == ask(bm, i - 1))
					bl = bm;
				else
					br = bm;
			}

			arr[i] = arr[bl];
		}                        
	}

	cout << "Ready!" << endl;

	cout << k << endl;

	forn(i, n)
		cout << arr[i] << ' ';


	return 0;
}