#include <bits/stdc++.h>

using namespace std;

struct gg {
    int next, nx;
    int size;
};



gg mas[40000];

int getV(int v) {
    if(mas[v].next != v) {
        mas[v].next = getV(mas[v].next);
    }
    return mas[v].next;
}

void merge(int a, int b) {
    a = getV(a);
    b = getV(b);
    if(a != b) {
        if(mas[a].size > mas[b].size) {
            mas[b].next = a;
            mas[a].size += mas[b].size;
        } else {
            mas[a].next = b;
            mas[b].size += mas[a].size;
        }
    }
}

int main() {
    //freopen("video.in", "r", stdin);
    //freopen("video.out", "w", stdout);
    int n, x;
    cin >> n;
    for(int i = 0; i < n; i++) {
        mas[i].size = 1;
        mas[i].next = i;
        mas[i].nx = -1;
    }
    //mas[n-1] = -1;
    int t = 1;
    set <int> gt;
    for(int i = 1; i < n; i++) {
        int l = 0, r = i-1, m;
        while(l < r) {
            m = (l+r+1)/2;
            gt.clear();
            for(int j = m; j <= i; j++) {
                gt.insert(getV(j));
            }
            if(m > i) return -1;
            cout << "? " << m+1 << ' ' << i+1 << endl;
            cin >> x;
            if(x < gt.size()) {
                l = m;
            } else {
                r = m-1;
            }
        }
       // m = (l+r+1)/2;
        gt.clear();
        for(int j = l; j <= i; j++) {
            gt.insert(getV(j));
        }
        //cout << 'x' << gt.size() << endl;
        if(l > i) return -1;
        cout << "? " << l+1 << ' ' << i+1 << endl;
        cin >> x;
        if(x < gt.size()) {
            merge(l, i);
        }
    }
    gt.clear();
    for(int i = 0; i < n; i++) {
        gt.insert(getV(i));
    }
    int h = gt.size();
    cout << "Ready!" << endl << h << endl;
    int f = 1, z;
    for(int i = 0; i < n-1; i++) {
        z = getV(i);
        if(mas[z].nx == -1) {
            mas[z].nx = f++;
        }
        if(mas[z].nx < 1 || mas[z].nx > h) return -1;
        cout << mas[z].nx << endl;
    }
    z = getV(n-1);
        if(mas[z].nx == -1) {
            mas[z].nx = f++;
        }
        cout << mas[z].nx << endl;
    cout.flush();
    return 0;
}


/*

3 3
111
121
111
*/
