#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>

using namespace std;

#define lint long long int

int main()
{
	int n;


	cin >> n;

	vector<int> v;
	//v.resize(n + 1, 1);

	for (int i = 0; i <= n; i++)
		v.push_back(i);

	for (int i = 1; i <= n; i++)
		for (int j = i + 1; j <= n; j++)
		{
			//int a, b;
			cout << "? " << i << " " << j << endl;
			cout.flush();

			int x;
			cin >> x;
			if (x == 1)
				v[j] = v[i];
		}

	set<int> s;
	for (int i = 1; i <= n; i++)
		s.insert(v[i]);

	map<int, int> m;
	
	int cur = 1;
	for (auto it = s.begin(); it != s.end(); ++it)
	{
		m[*it] = cur++;
	}

	cout << "Ready!" << endl;

	cout << s.size() << endl;

	for (int i = 1; i <= n; i++)
		cout << m[v[i]] << " ";

	//cin >> n;


	return 0;
}