#include <stdio.h>
#include <math.h>
#include <time.h>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <queue>
#define ll long long int;
using namespace std;
const int mod=1e9+7;

int a[3333],r[3333],cr[3333];

int main(){
#pragma warning(disable:4996)
#pragma comment(linker,"/STACK:536870912")
#ifdef _DEBUG
	//freopen("input.txt","rt",stdin);
	//freopen("output.txt","wt",stdout);
#else
	//freopen("video.in","rt",stdin);
	//freopen("video.out","wt",stdout);
#endif
	int n,i,j,e,pr,c,x,s;
	scanf("%d",&n);
	e=0;
	pr=0;
	for(i=0;i<3333;i++){
		cr[i]=-1;
	}
	for(i=0;i<n;i++){
		printf("? 1 %d\n",i+1);
		fflush(stdout);
		scanf("%d",&c);
		if(c>pr){
			pr=c;
			a[i]=e;
			r[e]=i;
			cr[i]=e;
			e++;
		} else{
			if(c==1){
				j=0;
				a[i]=cr[j];
				cr[j]=-1;
				cr[i]=a[i];
				r[a[i]]=i;
			}
			x=c;
			for(j=0;j<i;j++){
				if(cr[j]>=0){
					if(j+1==i){
						c=1;
					} else{
						printf("? %d %d\n",j+2,i+1);
						fflush(stdout);
						scanf("%d",&c);
					}
					if(c==x){
						a[i]=cr[j];
						cr[j]=-1;
						cr[i]=a[i];
						r[a[i]]=i;
						break;
					}
					if(c==1){
						a[i]=a[i-1];
						cr[i-1]=-1;
						cr[i]=a[i];
						break;

					}
				}
			}
		}
	}
	printf("Ready!\n%d\n",e);
	fflush(stdout);
	for(i=0;i<n;i++){
		printf("%d ",a[i]+1);
	}
	fflush(stdout);
	scanf("%d",&x);

	return 0;
}