#include <bits/stdc++.h>
using namespace std;
const int N=3000;
int cl[N],cc[N]; // Color Last , Current Color

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

    cl[0]=0;
    cc[0]=0;
    int cur=1; // Current Color Cnt

    for(int i=1; i<n; i++)
    {
        int fres,sres;
        cout<<"? 1 "<<i<<"\n";
        cout.flush();
        cin>>fres;
        cout<<"? 1 "<<i+1<<"\n";
        cout.flush();
        cin>>sres;
        if(fres!=sres)
        {
            cc[i]=cur;
            cl[cur]=i;
            cur++;
        }
        else
            for(int j=0; j<cur; j++)
                if(cl[j]==i-1)
                {
                    cc[i]=j;
                    cl[j]=i;
                    break;
                }
                else
                {
                    cout<<"? "<<cl[j]+1<<' '<<i+1<<"\n";
                    cout.flush();
                    cin>>fres;
                    cout<<"? "<<cl[j]+2<<' '<<i+1<<"\n";
                    cout.flush();
                    cin>>sres;
                    if(fres==sres)
                    {
                        cc[i]=j;
                        cl[j]=i;
                        break;
                    }
                }
    }

    cout<<"Ready!\n";
    cout.flush();
    cout<<cur<<"\n";
    cout.flush();
    for(int i=0; i<n; i++)
        cout<<cc[i]+1<<' ';
    cout.flush();
    return 0;
}
