#include<bits/stdc++.h>

using namespace std;

typedef long long lint;

#define X first
#define Y second
#define F(i, l, r) for(auto i = l; i != r; i++)
#define Df(i, l, r) for(auto i = l; i != r; i--)
#define rs resize
#define asg assign
#define mk make_pair
#define ins insert
#define era erase
#define all(x) x.begin(),x.end()
#define ret return
#define cont continue
#define brk break

int n;

vector<int> col;

int ask(int i, int j){
    i++; j++;
    printf("? %d %d\n", i, j);
    fflush(stdout);
    int res;
    scanf("%d", &res);
    ret res;
}

int cc = 2;
int prv = 1;
set<int> was;

int main(){
    scanf("%d", &n);
    col.rs(n); col.asg(n, 0);
    col[0] = 1;
    F(i, 1, n){
        int curr = ask(0, i);
        if(curr != prv){
            prv = curr;
            col[i] = cc++;
            cont;
        }
        int nv = 1;
        Df(j, i - 1, -1){
            int cv = ask(j, i);
            if(cv != nv){was.ins(col[j]); nv = cv; cont;}
            if(was.find(col[j]) != was.end()){cv = nv; cont;}
            col[i] = col[j];
            brk;
        }
        was.clear();
        prv = curr;
    }
    printf("Ready!\n%d\n", cc - 1);
    F(i, 0, n)
        printf("%d ", col[i]);
    printf("\n");
    fflush(stdout);
    ret 0;
}
