#include <iostream>
#include <algorithm>
#include <fstream>
using namespace std;

int main()
{
    cin.tie(0);
    int kappa[3010];
    int tarra[3010];
    int kek[3010];
    int i,j,n,t,c,l,r;
    int flag=1;
    int lol;
    cin>>n;
    kappa[1]=1;
    tarra[1]=1;
    for (i=2;i<=n;i++)
    {
    cout<<"?"<<" "<<1<<" "<<i<<endl;
    cout.flush();
        cin>>t;
        if (t>flag){flag++; kappa[i]=flag;
        } else{
            l=1;r=i;
            while(r-l>1){
                    c=(r+l)/2;
                cout<<"? "<<c<<" "<<i<<endl;
                cout.flush();
                cin>>t;
                if (t==tarra[c]) {l=t;} else {r=t;}
            }
            kappa[i]=kappa[l];
        }
        for (j=0;j<=(i+1);j++){
            kek[j]=0;
        }
        lol=1;
        kek[kappa[i]]=1;
        for(j=i-1;j>-1;j--){
            if (kek[kappa[j]]==0){
                lol++;
                kek[kappa[j]]=1;
            }
            tarra[j]=lol;
        }
    }
    cout<<"Ready!"<<endl;

    cout<<flag<<endl;
    for (i=1;i<=n;i++){
        cout<<kappa[i]<<" ";
    }
    return 0;
}
