#include <vector>
#include <cmath>
#include <algorithm>
#include <climits>

using namespace std;

#if 1
#include <iostream>
#else
#include <fstream>
ifstream cin("video.in");
ofstream cout("video.out");
#endif

	int n;
vector<vector<int> > m;

int ask(int a, int b)
{
	if (b <= a)
		return 1;
	if(m[a][b])
		return m[a][b];
	cout << "? " << a + 1 << " " << b + 1 << endl;
	cout.flush();
	int ans;
	cin >> ans;
	m[a][b] = ans;
	return ans;
}

int differ(int a, int b, int c)
{
	return ask(a, b) + ask(b, c) - ask(a, c);
}

bool different(int a, int b)
{
	return ask(a, b) >= (b - a + 1);
}

bool unique(int a, int b)
{
	return ask(a, b) <= 1;
}

int u = 0;

vector<int> ans;
vector<int> mp;

void fill(int pos, int val)
{
	int t = ans[pos];
	for (int i = pos; ans[i] == t; ++i)
	{
		ans[i] = val;
	}
}

void solve(int a, int b)
{
	if (b >= n)
		b = n - 1;
	if (unique(a, b))
	{
		++u;
		for (int i = a; i <= b; ++i)
		{
			if (ans.size() <= i)
				ans.resize(2 * b);
			ans[i] = u;
		}
		return;
	}
	if (different(a, b))
	{
		for (int i = a; i <= b; ++i)
		{
			++u;
			if (ans.size() <= i)
				ans.resize(2 * b);
			ans[i] = u;
		}
		return;
	}
	if (min(n - 1, a + b / 2) != b)
		solve(a, a + b / 2);
	if (a + b / 2 + 1 != a)
		solve(a + b / 2 + 1, b);
	
	int j = a + b / 2 + 1;
	int dd = 0;
	
	for (int i = a + b / 2; (i >= a) && (j <= b); --i)
	{
		int z = ask(i, j);
		if (z - dd == 1)
		{
			u++;
			fill(j, u);
			ans[i] = u;
			dd++;
		}
		else
		{
			break;
		}
		++j;
	}
}

int main()
{
	cin >> n;
	
	m.resize(n);
	for (int i = 0; i < n; ++i)
		m[i].resize(n);
	ans.resize(n);
	solve(0, n - 1);
	
	int last = -1;
	int am = 0;
	
	cout << "Ready!" << endl;
	cout.flush();
	
	vector<int> ff;
	
	
	mp.resize(ans.size() + 2, 0);
	
	for (int x : ans)
	{
		if (last != x)
		{
			am++;
			last = x;
		}
		if (!mp[x])
			mp[x] = am;
		ff.push_back((mp[x] - 1) % (ask(0, n - 1)) + 1);
	}
	cout << ask(0, n - 1) << endl;
	for (int x : ff)
		cout << x << " ";
	cout << endl;
	
	return 0;
}
