#include <stdio.h>

int n, a[3000], k = 1, tmp, prev, vis[3000], ind;

int main()
{
	scanf("%d", &n);
	a[0] = 1;
	prev = 1;
	for (int i = 1; i < n; i++)
	{
		printf("? 1 %d\n", i + 1);
		fflush(stdout);
		scanf("%d", &tmp);
		if (tmp > prev)
		{
			k++;
			a[i] = k;
		}
		prev = tmp;
	}
	for (int i = 1; i < n; i++)
	{
		int max = 1;
		for (int j = 0; j < i; j++)
			if (a[j] > max)
				max = a[j];
		if (a[i] == 0)
			if (max == 1)
				a[i] = 1;
			else
			{
				prev = 1;
				for (int j = 1; j <= k; j++)
					vis[j] = 0;
				for (int j = i - 1; j >= 0; j--)
				if (!vis[a[j]])
					{
						printf("? %d %d\n", j + 1, i + 1);
						fflush(stdout);
						scanf("%d", &tmp);
						if (tmp == prev)
						{
							ind = a[j];
							break;
						}
						vis[a[j]] = 1;
					}
				a[i] = ind;
			}
	}
	printf("Ready!\n");
	fflush(stdout);
	printf("%d\n", k);
	fflush(stdout);
	for (int i = 0; i < n; i++)
		printf("%d ", a[i]);
	printf("\n");
	fflush(stdout);
	return 0;
}