#include <stdio.h>
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;

long long a[5000];
map <pair <int, int>, long long> m;

int main()
{
	long long n;
	cin >> n;

	a[0] = 1;
	long long cnt = 1;
	int q = 0;
	for (long long i = 1; i < n; i++)
	{
		long long x;
		if (m[make_pair(1, i + 1)] == 0)
		{
			cout << "? 1 " << i + 1 << endl;
			q++;
			cin >> x;
			m[make_pair(1, i + 1)] = x;
		}
		else
			x = m[make_pair(1, i + 1)];
		if (x > cnt)
		{
			cnt++;
			a[i] = cnt;
		}
		else
		{
			long long j = i;
			long long cnt2 = 1;
			while (j > 0)
			{
				long long k;
				if (m[make_pair(j, i + 1)] == 0)
				{
					cout << "? " << j << " " << i + 1 << endl;
					q++;
					cin >> k;
					m[make_pair(j, i + 1)] = k;
				}
				else
					k = m[make_pair(j, i + 1)];

				if (k > cnt2)
					cnt2++;
				else
       	{
       		long long fl = 0;
       		if (q >= 72000)
						while(1);
       		
       		long long r;
       		if (m[make_pair(j, i)] == 0) 
       		{
       			cout << "? " << j << " " << i << endl;
       			q++;
       			cin >> r;
       			m[make_pair(j, i)] = r;
       		}
       		else
       			r = m[make_pair(j, i)];	

       		if (r == k)
       		{
       			a[i] = a[j - 1];
       			fl = 1;
       		}
       		if (fl)
       			break;
       	}				
       	j--;
			}
		}
	}	

	cout << "Ready!" << endl;
	cout << cnt << endl;
	for (long long i = 0; i < n; i++)
		cout << a[i] << " ";
     
  return 0;
}