#include <iostream>
#include <vector>

using namespace std;

vector<pair<int, int> > cur;
int anss[3005];

int main()
{
	cur.push_back({0, 1});
	anss[0] = 1;
	int n;
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		cout << "? 1 " << i + 1 << endl;
		int ans = 0;
		cin >> ans;
		if (ans > (int)cur.size())
		{
			cur.push_back({i, cur.size() + 1});
			anss[i] = cur.size();
		}
		else
		{
			int l = 0, r = cur.size();
			while (r - l > 1)
			{
				int m = (l + r) / 2;
				cout << "? " << cur[m].first + 1 << " " << i + 1 << endl;
				int ans;
				cin >> ans;
				if (ans > cur.size() - m)
				{
					r = m;
				}
				else
				{
					l = m;
				}
			}
			cur.push_back({i, cur[l].second});
			anss[i] = cur[l].second;
			cur.erase(cur.begin() + l);
		}
	}
	cout << "Ready!" << endl;
	cout << cur.size() << endl;
	for (int i = 0; i < n; i++)
		cout << anss[i] << " ";
	cout << endl;
}
